Home  >  Article  >  Operation and Maintenance  >  How to configure web server with Nginx

How to configure web server with Nginx

PHPz
PHPzforward
2023-05-14 16:40:141943browse

1. View Nginx configuration file

Command nginx -t, as shown in the figure

How to configure web server with Nginx

2. Enter the configuration file directory and view the directory

cd /usr/loxa/nginx/conf, you can see that there is an nginx.conf file and a vhost directory

How to configure web server with Nginx

3. Let’s edit nginx.conf first, the main service

How to configure web server with Nginx

Here is another configuration

How to configure web server with Nginx

Finally, you can import the vhost file just now. At the beginning, it is empty

How to configure web server with Nginx

Next, let’s take a look at the files in this directory and open one to view

How to configure web server with Nginx

This is all the files of the two sites

How to configure web server with Nginx

How to configure web server with Nginx

After the change, service nginx reload (nginx configuration reload)

The above is the detailed content of How to configure web server with Nginx. For more information, please follow other related articles on the PHP Chinese website!

Statement:
This article is reproduced at:yisu.com. If there is any infringement, please contact admin@php.cn delete
Previous article:How nginx configures HSTSNext article:How nginx configures HSTS