Create a static website file

Create a folder to store the static HTML file, in this case, /var/www/http/, create an HTML file,

Specify the root directory of nginx under this directory

nginx

# nginx -s reload
Copy the code

At this point, we see that the home page becomes our own HTML home page

forNginxOpen the log

Log_format is followed by the name of the log format main, and the second parameter is the specific definition of each log format (here we use the default log format, which uses variables like $remote_ADDR, and more variables, It can be viewed in the official documentation,nginx.org/en/docs/htt…) After specifying a defined log format, we can use the log format in each server block and specify the path to store the log in each server block. Here we will access the log using the main format defined above. Logs /yang_test1.access.log.

nginx
nginx/log/
yang_test1.access.log