Focus on cloud service provider activities
Notes on website operation and maintenance

Record the process of manually binding domain names with Nginx

If we deploy the one click installation package or panel for the WEB environment in the server, we can directly use the one click package command or visual command to add and modify the domain name binding. If we deploy Nginx manually, we need to deploy domain name binding manually. Before binding the domain name, we need to resolve the domain name A record to the current server IP in advance, and then modify the Nginx configuration file.

 vi /etc/nginx/nginx.conf

Find the corresponding CONF file or the configuration file of a site.

 server { listen 80 default_server; server_name www.laozuo.org laozuo.org; root /home/web1; location / { } error_page 404 /404.html; location = /40x.html { } error_page 500 502 503 504 /50.xhtml; location = /50x.html { } } server { server_name www.lezaiyun.com lezaiyun.com; root /home/web2; location / { } error_page 404 /404.html; location = /40x.html { } error_page 500 502 503 504 /50x.html; location = /50x.html { } }

In the above code, we add and modify the domain name resolution.

Finally, after saving and exiting, restart Nginx to take effect.

Domain name host preferential information push QQ group: six hundred and twenty-seven million seven hundred and seventy-five thousand four hundred and seventy-seven Get preferential promotion from merchants.
Like( zero )
Do not reprint without permission: Lao Zuo's Notes » Record the process of manually binding domain names with Nginx


Scan the code to follow the official account

Get more news about webmaster circle!
Entrepreneurship, operation and new knowledge