Windows environment installed Nginx

 

 

 This paper records nginx installed in windows, also refer to: http: //blog.163.com/njut_wangjian/blog/static/1657964252013327103716818/

   My local environment: win10-64 bit.

 1. official website to download the appropriate nginx installation package, http://nginx.org/en/download.html ;

Download decompress, unzip the file into a directory of their favorite, I unzip files on the d under the root directory, as shown below:

Cmd window into the window, as shown below in the command input, into nginx directory (D: /nginx-1.8.1), using the " Start nginx.exe  " nginx for installation, as shown below:

 

After successful installation, the "task manager" will see "nginx.exe" process, as shown below:

 

In the browser address bar enter: 127.0.0.1, as shown below will see the welcome screen of nginx

If the discovery process does not, then state your installation fails, you can go to your D: View \ Under error logs files under nginx-1.8.1 directory under the folder,
If it is found which read:
State your 80 ports are occupied, the next command or cmd dos execute: netstat -aon | findstr: 80 to see if port 80 is occupied, and if occupied, then you need to modify the registry, as follows:
1. Open the registry: regedit
 
2、找到:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\HTTP
 
3, to find a REG_DWORD type of item Start, change it to 0
 
4, restart the system, System process will not take 80 ports
 
At this moment, you can perform again 

 The appropriate command: Start nginx.exe  commands.

nginx.exe -s stop // stop nginx

nginx.exe -s reload // reload nginx

nginx.exe -s quit // Exit nginx

Note: the above command, .exe can be removed

Corresponding to the operation command as shown below:

 

2. nginx configuration file
nginx profile for nginx.conf, the corresponding operation as shown below:

 

nginx configuration file parsing:

 

Guess you like

Origin www.cnblogs.com/mahmud/p/11416860.html