Get the App
SLTechnology News&Howtos  ›  Servers  › 

Install and configure nginx under windows

Shulou Source: shulou.com Published: 2022-06-02 12:39:59 10月04日 Update

1. Download nginx

Download the window version of nginx from the official website.

Http://nginx.org/

two。 Configure environment variables

Decompress to a local path

Open the cmd window, cd to the directory of nginx

Note that you need to add the / d parameter to cd, otherwise you may not be able to switch it.

Then execute nginx-v to see the version of nginx

3. Configure nginx

Find the conf/nginx.conf file in the nginx directory

Open the file and modify the following configuration

One is to change the port number to 8080, and the other is to specify the location of the website as f:\ nginx-1.12.2\ html

4. Start nginx

Execute nginx directly from the cmd command line to start nginx

5. Access the default page

After Nginx starts, visit http://localhost:8080 in the browser and you can see the default welcome page.

At this point, the nginx configuration under window is complete.

More commands can be viewed with nginx-h

The explanation of each parameter is more popular, so it will not be explained one by one.

Tags: Configuration parameters commands files directories pages popular location variables slogans times more browsers versions environments websites paths facets switching browsing Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno MySQL Apple Docker Shulou Tech Info macOS