1. The virtual host does not need to be configured directly on the nginx.conf, but needs to add the include *.conf under nginx.conf.
2. Create a new folder with the new suffix conf file. Code examples are as follows
server {
Listen 80;
server_name www.wuliaoren.org;
Location/{
Root html/www;
Index index.html index.htm;
}
}
3. The path from the code point to the Web page
--------------------------------------------------------------------------------------------------------------- -------
Diff Nginx.conf.default Nginx.conf vs. two file contents
Egrep-v "#|^$" nginx.default.conf > nginx.conf #号和空行过滤 The default file and generate a new file
Nginx.conf
--------------------------------------------------------------------------------------------------------------- ----------
Sed-n ' 1,8p ' www.conf output 1-8 rows of www.conf to the screen
Sed-n ' 1,8p ' www.conf > blog.conf www.conf 1-8 lines of content, creating a new file blog.conf
--------------------------------------------------------------------------------------------------------------- ------------
/SBIN/NGINX-T Check if Nginx is in normal condition
/sbin/nginx-s Reload to refresh the configuration
Change the Conf file about Nginx, you must execute the following two lines of command.
Nginx Learning record