Joke Collection Website - Mood Talk - Is there any selfless lady who can tell me how to configure Nginx under win?

Is there any selfless lady who can tell me how to configure Nginx under win?

Mainly describes how to install and configure nginx under windows (this example is under win8 environment)

Download the corresponding installation package from the nginx official website: http://nginx.org/?< /p>

Recommend downloading

?Download the stable version

Extract to the corresponding directory, for example, my e drive

Then change the directory name to nginx

Enter the nginx directory

Double-click nginx.exe to start nginx

At this time

Enter http:localhost directly in the browser address bar You will see the welcome page, indicating that your virtual host has been set up

But sometimes we need to configure the root path of the project? By default, its root is the html folder in the nginx directory

p>

If modified, open nginx.conf in the conf directory.

Find the server option and modify the root option in location.

For example, I modified it to D:/webroot

The decompression package only starts the nginx server and runs the program, but if you want to restart or stop the service, you must manually restart or stop it under the dos command. , which is quite troublesome. I wrote the restart and stop commands using batch processing: as follows

stop.bat

@echo?off

%~d0?

cd?%~dp0?

nginx?-s?quit?restart.bat

@echo?off

%~d0?

cd?%~dp0?

nginx?-s?reload?