代理到同一二级域名的不同后台端口
server {
listen 80;
server_name 二级域名;
location /dev-api {
rewrite ^.+dev-api/?(.*)$ /$1 break;
include uwsgi_params;
proxy_pass http://localhost:8080/;
}
location /prod-api {
rewrite ^.+prod-api/?(.*)$ /$1 break;
include uwsgi_params;
proxy_pass http://localhost:8081/;
}
}
代理到不同二级域名
server {
listen 80;
server_name 二级域名;
location / {
root /www/wwwroot/farm/dist;
index index.html index.htm;
}
}
server {
listen 80;
server_name 二级域名;
location / {
root /www/wwwroot/science/dist;
index index.html index.htm;
}
}
最后
以上就是冷艳玉米最近收集整理的关于nginx域名配置的全部内容,更多相关nginx域名配置内容请搜索靠谱客的其他文章。
本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
发表评论 取消回复