【问题标题】:How to I override nginx ssl protocols?如何覆盖 nginx ssl 协议?
【发布时间】:2016-12-14 08:20:32
【问题描述】:

我是使用 nginx 1.6.2 版本的 web 开发人员,使用 openssl 1.0.2h 我管理很多域。 并且对安全非常感兴趣。

所以我的默认 nginx ssl 设置就在这里。 default.conf

server {
listen 443;
server_name localhost;

ssl on;
ssl_certificate /etc/nginx/SSL/***.crt;
ssl_certificate_key /etc/nginx/SSL/***.key;

ssl_protocols   TLSv1 TLSv1.1 TLSv1.2;

location ~ {
    root    /etc/nginx/html;
    index   index.php;
    return 470;

    include /etc/nginx/sites-enabled/error_config;
}

}

如您所见,我只使用了 ssl_protocols TLSv1、TLSv1.1、TLSv1.2 我想要一个域,getssltest.ga 只想使用 TLSv 1.1 和 TLSv 1.2 但我试图以任何方式更改虚拟主机配置文件。 但是,只需添加 'ssl_protocols TLSv1.1 TLSv1.2;'不验证。 像上面这样。

server {
    listen 443;
    server_name getssltest.ga www.getssltest.ga;

    ssl_protocols   TLSv1.1 TLSv1.2;
    ssl on;
    ssl_certificate      **;
    ssl_certificate_key  **;

    include /etc/nginx/sites-enabled/ssl_config;

    proxy_http_version 1.1;

我找不到路。 (我可以在这里查看协议https://www.ssllabs.com/ssltest/analyze.html?d=getssltest.ga

如何将 ssl_protocol 覆盖到我的虚拟主机之一?

谢谢。

【问题讨论】:

    标签: ssl nginx protocols config


    【解决方案1】:

    你可以查看文档http://nginx.org/en/docs/http/configuring_https_servers.html,配置应该是这样的:

    server {
        listen              443 ssl;
        server_name         getssltest.ga www.getssltest.ga;
        ssl_certificate     *;
        ssl_certificate_key *;
        ssl_protocols       TLSv1.1 TLSv1.2;
        ...
    }
    

    【讨论】:

    • 这不适用于虚拟主机!
    • 这就是 ssl 的工作原理。 SSL 首先创建连接,然后进行 SNI。 Nginx 将选择一个 ssl 设置(例如在默认服务器配置中)来创建 ssl 连接。 stackoverflow.com/questions/27213607/…
    猜你喜欢
    • 1970-01-01
    • 2021-08-09
    • 2015-10-04
    • 2015-05-21
    • 1970-01-01
    • 2017-04-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多