@Tyhj
2019-01-23T23:00:48.000000Z
字数 545
阅读 1401
linux
安装homebrew
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
安装nginx
brew install nginx
启动nginx
brew services start nginx
成功后,使用浏览器打开http://localhost:8080
nginx安装文件目录
/usr/local/Cellar/nginx
nginx配置文件目录
/usr/local/etc/nginx
config文件目录
/usr/local/etc/nginx/nginx.conf
配置静态文件服务
vim /usr/local/etc/nginx/nginx.conf
随便配置一下,重新开启服务
brew services restart nginx
设置开机启动
sudo launchctl load -w /Library/LaunchDaemons/homebrew.mxcl.nginx.plist
sudo launchctl load -w /Library/LaunchDaemons/homebrew.mxcl.nginx.plist
卸载
brew uninstall nginx