The main reason for the installation was to use Brew, so Brew was installed first

Install the Brew

Error 443 will be generated if the host file is installed using the Brew official command

Modify the Hosts

  • On the desktop, use the shortcut keys Shift + Command +G to go to the /etc/hosts folder
  • Copy a Hosts file to the desktop, and then double-click to open the Hosts to copy out the desktop, add 199.232.28.133 raw.githubusercontent.com in the last line
  • Save the file and overwrite the original hosts file

Modify the Brew installation file

  • Run a terminal, type the command: curl – fsSL raw.githubusercontent.com/Homebrew/in… >> brew_install
  • Open this address in a browser: raw.githubusercontent.com/Homebrew/in…
  • Locate the brew_install file in the root directory and double-click to open it
  • Copy the content from your browser into the brew_install file and overwrite the original content
  • The BREW_REPO = “github.com/Homebrew/br…” **

Install the Brew

  • Run /bin/bash. /brew_install in terminal
  • When **==> Tapping homebrew/core appears

Cloning into ‘/usr/local/Homebrew/Library/Taps/homebrew/homebrew-core’… **, directly control + C to terminate the run

  • CD “$(brew –repo)/ Taps/”

2: mkdir homebrew && CD homebrew 3: git clone git://mirrors.ustc.edu.cn/homebrew-core.git speed (process may be slower, miniaturization:)

  • When done, CD to the root directory or reopen a terminal window
  • Run /bin/bash. /brew_install again until successful
  • Perform the brew update

At this point, Brew installation is complete

Install Nginx

  • Run brew install nginx on the terminal
  • complete