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

How to configure nginx multiple websites

WBOY
Release: 2023-05-12 14:04:06
forward
1743 people have browsed it

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!

Related labels:
source:yisu.com
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template