Home  >  Article  >  Operation and Maintenance  >  How to configure nginx multiple websites

How to configure nginx multiple websites

WBOY
WBOYforward
2023-05-12 14:04:061652browse

Configuration file:

The code is as follows:

http {
server {
listen 80;
server_name www.domain1.com;
access_log logs/domain1.access.log main;
location / {
index index.html;
root /var/www/domain1.com/htdocs;
}
}

server {
listen 80;
server_name www.domain2.com;
access_log logs/domain2.access.log main;
location / {
index index.html;
root /var/www/domain2.com/htdocs;
}
}
}

Note:
Just add a new module in the module; specific basis Configure according to your actual needs.

The above is the detailed content of How to configure nginx multiple websites. 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