[Nginx] Install Nginx under Windows

1. Install Nginx

WeChat screenshot_20211204092613.png

1.1 Unzip and start Nginx

Unzip the downloaded file nginx-1.16.1, open the cmd window cdto the root directory, and start Nginxstart Nginx through the startup command:

image.png

When pressing Enter, the window will flash for a while. At this time, service 1 has been successfully started. We can use the console command to netstat -ano | findstr :80 | findstr LISTENINGcheck whether port 80 has been monitored.
image.png

As you can see, the 80port is already listening. Open the browser and enter: http://localhost:80You can visit the Nignx welcome page.

image.png

1.2 Stop Nginx

Stopping Nginxis also very simple. Execute in the root directory nginx -s stopto stop the Nginx service. There is another way nginx -s quitto exit all Nginx services by command.

image.png

2. View Nginx commands

Common parameters effect
nginx -v Nginx version information
nginx -V Details, including compiled modules
nginx -t Followed by the configuration file address, check whether the syntax of the configuration file is correct
nginx -c Specify the Nginx configuration file
nginx -s The most important options, stop |quit: stop the Nginx service, reload: start the Nginx service with hot reload, reopen: reopen the log file

image.png

3. Nginx preliminary configuration

The basic configuration of Nginx can be divided into the following five parts:

  • Initial configuration
  • basic grammar
  • http service configuration
  • tcp/udp
  • reverse proxy

Guess you like

Origin blog.csdn.net/weixin_43853746/article/details/121711695
Recommended