Current location - Quotes Website - Team slogan - How does Cloud Server modify the default port of Nginx?
How does Cloud Server modify the default port of Nginx?
Implementation of modifying nginx.conf file.

1 server {

2 Listen? 80;

3 server_name? Local host;

four

5 ……

6 }

change into

0 1 server {

Listen, okay? 8 1;

03 server name? Local host;

04

05 Position/{

06? html

07 index? index.html· index.htm;

08 }

09 ……

10 }

Of course, it can be changed to 8080,808 1 or something, and it doesn't have to be 81,but make sure that iptable releases access to this port.

Please note the configuration of the location:

Root? html? # root directory, relative to the installation directory?

Index? index.html? index.htm; ? # Default Home Page

By default, you put the files in the html folder under the installation directory.