Nginx modify the port number

<!-- text-->

Modify the nginx.conf file implementation. The path of this file is /usr/local/nginx/conf/nginx.conf on Linux and \conf\nginx.conf under Windows.

server {
	listen       80;
	server_name  localhost;
	
	……
}
改成

server {
	listen       81;
	server_name  localhost;
	
	location / {
		root   html;
		index  index.html index.htm;
	}
	……
}

Node under server:

listen: listen on port 80

server_name: which address to forward to

proxy_pass: which address to proxy to

 

nginx common commands (to enter the nginx directory):

Start: start nginx

Restart: nginx -s reload

<!-- Copyright -->

Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=326562858&siteId=291194637