Installation environment:
win10
nginx-1.17.2
Steps: strong>
1. Open nginx.conf
Path: \nginx-1.17.2\conf\nginx.conf
Second, edit
Configure cross-domain and proxy folder path
3. Start nginx
Start in the nginx folder path cmd (check nginx version: nginx -v)
Four. Verification
Enter localhost for verification in the browser
Five. Questions
1. If nginx.conf is modified, it has been activated For nginx, after the modification is completed, you need to read the configuration again and restart the service.
Re-read the file: nginx -s reload
Restart the service: nginx -s reopen
2. During the learning process, I encountered a 403 forbidden situation.
On the Internet, it is said that it is a permission problem. You can change user nobody to user root, but they are all solutions under linux. I am in a win10 environment. I tried to change various users, but there was no response.
During the research process, it was found that each run Command: start nginx will start two nginx.exe processes. I didn’t know at the beginning, I started more than a dozen processes (normally there should be only two), and finally killed them all, reconfigured them again, and no more 403s were reported. (I don’t know if this is the reason.)
Six. Shutdown
Because nginx is started through the command line, it will not be closed when the process is closed. The same command is required.
Exit: nginx -s quit
Forced shutdown: nginx -s stop