Nginx 基于域名的虚拟主机配置
【摘要】 如下修改Nginx的配置文件,一般位于/etc/nginx/nginx.conf或/etc/nginx/conf.d/default.conf。 server { listen 80; server_name cms.xxx.com; root /usr/share/nginx/cms; # Load...
如下修改Nginx的配置文件,一般位于/etc/nginx/nginx.conf
或/etc/nginx/conf.d/default.conf
。
server {
listen 80;
server_name cms.xxx.com;
root /usr/share/nginx/cms;
# Load configuration files for the default server block.
include /etc/nginx/default.d/*.conf;
location / {
}
error_page 404 /404.html;
location = /40x.html {
}
error_page 500 502 503 504 /50x.html;
location = /50x.html {
}
}
server {
listen 80;
server_name blog.xxx.com;
root /usr/share/nginx/html;
# Load configuration files for the default server block.
include /etc/nginx/default.d/*.conf;
location / {
}
error_page 404 /404.html;
location = /40x.html {
}
error_page 500 502 503 504 /50x.html;
location = /50x.html {
}
}
【版权声明】本文为华为云社区用户转载文章,如果您发现本社区中有涉嫌抄袭的内容,欢迎发送邮件进行举报,并提供相关证据,一经查实,本社区将立刻删除涉嫌侵权内容,举报邮箱:
cloudbbs@huaweicloud.com
- 点赞
- 收藏
- 关注作者
评论(0)