问题描述
这是我在这里的第一篇文章,我在使用nginx在Ubuntu上托管两个内部.NET应用程序时遇到问题。我想要在子域上运行多个应用程序:
- app1> app1.domain.com
- app2> app2.domain.com
这是我的实际站点配置文件:
server {
server_name app1.domain.local;
listen 80;
location / {
root /var/www/html/app1;
proxy_pass http://localhost:5000/;
proxy_redirect http://localhost:5000/ http://app1.domain.local;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection keep-alive;
proxy_set_header Host $host;
proxy_cache_bypass $http_upgrade;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarder-Proto $scheme;
}
}
server {
server_name app2.domain.local
listen 80;
location / {
root /var/www/html/app2;
proxy_pass http://localhost:5003/;
proxy_redirect http://localhost:5003/ http://app2.domain.local;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection keep-alive;
proxy_set_header Host $host;
proxy_cache_bypass $http_upgrade;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarder-Proto $scheme;
}
}
server {
if ($host = domain.local) {
return 301 http://$host$request_uri;
}
listen 80 default;
listen [::]:80 default_server;
server_name *.domain.local;
return 404;
}
您能帮助我了解我需要在配置中进行哪些更改才能工作或如何对其进行调试吗?
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)