首页 > 解决方案 > CKAN ON HTTPS ERR_SSL_PROTOCOL_ERROR

问题描述

我尝试按照https://github.com/ckan/ckan/wiki/SSL将我的 CKAN 项目运行到 HTTPS

这是我的 nginx 配置文件

proxy_cache_path /tmp/nginx_cache levels=1:2 keys_zone=cache:30m max_size=250m;
proxy_temp_path /tmp/nginx_proxy 1 2;

#server {
#   listen 80 default;
#   server_name mindset.ccgeo.info:84;
#   return 301 https://$server_name$request_uri;
#}

server {
    listen 443 ssl;

    ssl_certificate host.cert;
    ssl_certificate_key host.key;
    ssl_session_timeout 1d;
    ssl_session_cache shared:SSL:10m;
    ssl_session_tickets off;

    client_max_body_size 100M;
    ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
    ssl_ciphers ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-CHACHA20-POLY1305:EC>
    ssl_prefer_server_ciphers off;

    add_header Strict-Transport-Security "max-age=63072000" always;
    ssl_stapling on;
    ssl_stapling_verify on;

    if ($scheme != "https") {
        return 301 https://$host$request_uri;
    }

    location / {
        proxy_pass http://127.0.0.1:8080/;
        proxy_set_header Host $host;
        #proxy_set_header X-Url-Scheme $scheme;
        proxy_set_header X-Forwarded-Proto $scheme;
        proxy_cache cache;
        proxy_cache_bypass $cookie_auth_tkt;
        proxy_no_cache $cookie_auth_tkt;
        proxy_cache_valid 30m;
        proxy_cache_key $host$scheme$proxy_host$request_uri;
        # In emergency comment out line to force caching;
        # proxy_ignore_headers X-Accel-Expires Expires Cache-Control;
    }
}
server {
  listen 80;
  server_name mindset.ccgeo.info:84;
  rewrite ^/(.*) https://mindset.ccgeo.info:84 permanent;
}

在我的 ckan.ini 中,我将 ckan.site_url 更改为

ckan.site_url = https://mindset.ccgeo.info:84

还添加了

ckan.devserver.ssl_cert = /etc/nginx/host.cert
ckan.devserver.ssl_key = /etc/nginx/host.key

我生成了我的 SSL 证书,我遵循 ckan 文档https://docs.ckan.org/en/2.9/maintaining/configuration.html?highlight=ssl#ckan-devserver-ssl-cert

当我重新加载页面时出现错误 ERR_SSL_PROTOCOL_ERROR 在此处输入图像描述

请提供任何帮助。提前致谢

标签: sslnginx-configckan

解决方案


推荐阅读