首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >NGINX配置Https

NGINX配置Https
EN

Stack Overflow用户
提问于 2016-05-26 18:42:39
回答 1查看 549关注 0票数 2

我正尝试在http和https上运行我的应用程序。应用程序呈现静态htmls以及它们的css‘和js’。我使用nginx为页面提供服务。我已经配置了我的nginx配置,但是页面不会在https上呈现。

当我点击http://subdomain.example.com时,它工作得很好!

然而,当我点击https://subdomain.example.com时,我在Chrome中得到了一个CONNECTION_RESET或CONNECTION_CLOSED错误。

下面是我的配置:

代码语言:javascript
复制
    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;
    }
}

在这方面请求您的帮助。

谢谢!

EN

回答 1

Stack Overflow用户

发布于 2016-05-26 20:42:02

我建议从您的配置中删除ssl on;

建议使用listen指令的ssl参数,而不要使用此指令。

来自nginx文档http://nginx.org/en/docs/http/ngx_http_ssl_module.html#ssl

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/37458518

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档