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!