Mac下Nginx的安装与配置
环境:MacBook Air M1, macOS Monterey 12.6 安装 建议选择homebrew安装,安装完成后会显示基本信息,后续如果要重新查看可通过命令实现。 brew install nginx 安装 brew info nginx 查看信息 Docroot is: /opt/homebrew/var/www The default port has been set in /opt/homebrew/etc/nginx/nginx.conf to 8080 so that nginx can run without sudo. nginx will load all files in /opt/homebrew/etc/nginx/servers/. To restart nginx after an upgrade: brew services restart nginx Or, if you don't want/need a background service you can just run: /opt/homebrew/opt/nginx/bin/nginx -g daemon off; 使用 brew services start nginx 启动 brew services stop nginx 停止 nginx -t 测试配置文件 ...