Skip to content

Latest commit

 

History

History
33 lines (20 loc) · 895 Bytes

install_nginx_in_mac_os_x_with_homebrew.md

File metadata and controls

33 lines (20 loc) · 895 Bytes

安装

使用brew安装nginx

brew install nginx

安装后可以看到提示

Docroot is: /usr/local/var/www

The default port has been set in /usr/local/etc/nginx/nginx.conf to 8080 so that
nginx can run without sudo.

nginx will load all files in /usr/local/etc/nginx/servers/.

To have launchd start nginx at login:
  ln -sfv /usr/local/opt/nginx/*.plist ~/Library/LaunchAgents
Then to load nginx now:
  launchctl load ~/Library/LaunchAgents/homebrew.mxcl.nginx.plist
Or, if you don't want/need launchctl, you can just run:
  nginx

启动

nginx

将文件复制到/usr/local/var/www可提供文件web访问下载

参考