1, the installation Command Line tools
|
2, installation brew command
1 |
|
3, install nginx
1 |
|
1.brew called Homebrew, the Mac is a package management tool, through the brew can easily install the software on a Mac or uninstall the software
- brew install software brew install nginx
- brew brew uninstall nginx uninstall software
- brew upgrade sudo brew update
- Review the installation information (frequently used, such as viewing the installation directory, etc.) sudo brew info nginx
- Check the software has been installed brew list
- Start: sudo nginx
- Close nginx service sudo brew services stop nginx
- Reload sudo
nginx -s reload
(after modifying the configuration file, an executable command) - Quick Stop
nginx -s stop
平稳退出
sudo nginx -s quit- View nginx nginx -V version and installation location of the local
-
Check the configuration, to check whether the correct sudo nginx -t (also can show the location of installation)
2. To achieve reverse proxy:
- Use vim Open: vim /usr/local/etc/nginx/nginx.conf
- Enter insert mode to write, esc to exit edit mode: wq exit the file