我正尝试在http和https上运行我的应用程序。应用程序呈现静态htmls以及它们的css‘和js’。我使用nginx为页面提供服务。我已经配置了我的nginx配置,但是页面不会在https上呈现。
当我点击http://subdomain.example.com时,它工作得很好!
然而,当我点击https://subdomain.example.com时,我在Chrome中得到了一个CONNECTION_RESET或CONNECTION_CLOSED错误。
下面是我的配置:
server {
listen 80;
server_name subdomain.example.com;
#charset koi8-r;
#access_log /var/log/nginx/log/host.access.log main;
location / {
root /var/www/html/htmls/;
index entergmat.html;
}
}
server{
listen 443 ssl;
ssl on;
server_name subdomain.example.com;
ssl_certificate /path/to/certificate.crt;
ssl_certificate_key /path/to/certificate.key;
# ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
# ssl_ciphers HIGH:!aNULL:!MD5;
keepalive_timeout 70;
location / {
root /var/www/html/htmls/;
index entergmat.html;
}
}在这方面请求您的帮助。
谢谢!
发布于 2016-05-26 20:42:02
我建议从您的配置中删除ssl on;:
建议使用listen指令的ssl参数,而不要使用此指令。
来自nginx文档http://nginx.org/en/docs/http/ngx_http_ssl_module.html#ssl
https://stackoverflow.com/questions/37458518
复制相似问题