1 Locate the nginx in the server
CD /etc/nginx vim nginx.conf (or sz nignx.conf)
2 Add the server to the nginx.conf file
Configure a server in HTTP {}
server {
listen 8001; # Port number server_name172.17. 014.; # server IP address charset UTf -8location / { root /home/dist/; Dist file location autoindex on; # enable nginx directory browse function index index.html index.html; Try_files $uri $uri/ /index.html; } location /web-rmtexec {/ / 172.17.1.8:8769; Address forwarding address of the back-end interface
}
#error_page 404 /404.html;
location = /40x.html {
}
#error_page 500 502 503 504 /50x.html;
location = /50x.html {
}
}
Copy the code
3 restart nginx
Service nginx status view nginx status service nginx restart reboot or CD usr/local. Nginx/sbin ps – ef | grep nginx view nginx process Kill -quit 1823(process number) nginx -s reload nginx -t stick to the configuration file
4 Supplementary Content
ESC :wq! Save ESC :q Forcibly exit sudo su switch to root account chomd 777 Modify permission SCP copy unzip rm -rf delete mv *.. / mobile
5 Supplementary content – Upload server A and copy it to server B
SCP dist. Zip juser@A Server address :/home/admin SSH juser@B Server address: CD /home/admin unzip dist. Zip rm -rf dist. /