【发布时间】:2018-04-27 06:48:20
【问题描述】:
大家好,
我正在尝试在 ubuntu 16.04 上发布我的示例 ASP.NET Core 应用程序,代理服务器是 Nginx。
我的服务器拥有LetsEncript 提供的 SSL 证书,一切正常。但是当我尝试使用与示例端口 8080 一起服务的 Web 应用程序时,它不起作用,并且即使我已经在默认文件中注释掉了 nginx 页面,它仍然显示。
server {
if ($host = www.mywebsite.com) {
return 301 https://$host$request_uri;
} # managed by Certbot
if ($host = mywebsite.com) {
return 301 https://$host$request_uri;
} # managed by Certbot
listen 80 default_server;
listen [::]:80 default_server;
location / {
proxy_pass http://localhost:8080;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection keep-alive;
proxy_set_header Host $http_host;
proxy_cache_bypass $http_upgrade;
}
server_name mywebsite.com www.mywebsite.com;
return 404; # managed by Certbot
}
(由于隐私,我需要不透露确切的域名)
顺便说一句,我的真实域工作正常,并且 localhost:8080 在服务器内正常运行。
【问题讨论】:
标签: ssl nginx .net-core ssl-certificate certbot