Installation and operation command mac nginx reverse proxy configuration

1, the installation Command Line tools

xcode-select --install

2, installation brew command

1

ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

3, install nginx

1

brew install nginx

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:

  1. Use vim Open: vim /usr/local/etc/nginx/nginx.conf
  2. Enter insert mode to write, esc to exit edit mode: wq exit the file

Guess you like

Origin blog.csdn.net/bangbDIV/article/details/84099162