SSL实验室 - HSTS无法正常工作 - Nginx

时间:2015-02-14 06:05:46

标签: ssl nginx openssl ssl-certificate

我无法使用SSL实验室获取HSTS状态。当我测试我的网站时,HSTS显示为“否”,但我在配置文件中配置了HSTS。我有nginx 1.6.2。以下是conf文件。任何帮助将受到高度赞赏。谢谢!

server {
listen 443;
ssl on;
ssl_certificate <<path to cerificate>>;
ssl_certificate_key <<path to key>>

add_header Strict-Transport-Security 'max-age=63072000; includeSubDomains; preload';

ssl_prefer_server_ciphers on;
ssl_ciphers "AES256+EECDH:AES256+EDH";
ssl_protocols TLSv1.2 TLSv1.1 TLSv1;

ssl_session_cache shared:SSL:10m;
ssl_session_timeout 10m;
keepalive_timeout 70;

resolver 8.8.8.8 8.8.4.4 valid=300s;
resolver_timeout 5s;

location /{
           proxy_pass http://localhost:4002;
           proxy_http_version 1.1;
           proxy_set_header Upgrade $http_upgrade;
           proxy_set_header Connection 'upgrade';
           proxy_set_header Host $host;
           proxy_cache_bypass $http_upgrade;
           }
}

1 个答案:

答案 0 :(得分:1)

root / usr / share / nginx / html; index index.html index.htm;

将index.html中的内容放在根位置,然后尝试在浏览器中打开它; index.html应该可以访问。