1. Introduction to Nginx
1. Nginx is a high-performance HTTP and reverse proxy server, as well as an IMAP/POP3/SMTP server
2. Download nginx http://nginx.org/en/download.html You can also download the stable version of nginx-1.12.2.zip
After downloading, decompress, the decompression is as follows
3. Start nginx
Double-click nginx.exe directly, a black pop-up window flashes after double-clicking
After the startup is successful, you can check whether the startup is successful in the task manager
If the startup is unsuccessful, it depends on the name of the folder. The file cannot appear in Chinese, so it must be named in English.
4. You can verify success in the browser
Enter the URL http://localhost:80 directly in the browser address bar
The default port 80 can be modified
The configuration file for modifying the port nginx is nginx.conf in the conf directory. The default configured nginx listening port is 80, which can be changed to the port you want to configure
4. Close nginx
You can end the process directly in the task management
You can also enter the nginx command nginx -s stop (quickly stop nginx) or nginx -s quit (stop nginx in an orderly manner) in cmd, you need to go to the nginx folder
5 nginx provides http service
Configure in nginx.conf
location ~ .*\.(gif|jpg|pdf|jpeg|png)$
{
#root D:/nginx-1.15.5/temp/images/;#Specify the image storage path (it can also be placed in the nginx folder path You can put other p disks)
root D:/tp/;
}
Then you can access the picture through the browser
Nginx 错误10013: An attempt was made to access a socket in a way forbidden
The cause of the error: Port 80 is occupied, causing nginx to fail to start.
By default, nginx cannot access the directory. If you need to access it, you need to configure autoindex on; you can access the directory
The following configuration is inaccessible or the root and autoindex comments cannot be accessed.
deny all; return 403;
You can also use nginx for reverse proxy