Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/django/19.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Django 带有SSL客户端证书验证的PaaS_Django_Authentication_Ssl_Heroku_Nginx - Fatal编程技术网

Django 带有SSL客户端证书验证的PaaS

Django 带有SSL客户端证书验证的PaaS,django,authentication,ssl,heroku,nginx,Django,Authentication,Ssl,Heroku,Nginx,我用python(Django)开发了一个应用程序,它使用Nginx作为服务器。 应用程序正在使用ssl客户端证书对用户进行身份验证, 我使用nginx服务器和以下配置实现了它: location / { proxy_set_header Host $http_host; proxy_set_header X-Forwarded-Proto https; proxy_set_header X-Forwarded-For $remote_addr; proxy_se

我用python(Django)开发了一个应用程序,它使用Nginx作为服务器。 应用程序正在使用ssl客户端证书对用户进行身份验证, 我使用nginx服务器和以下配置实现了它:

location / {
    proxy_set_header Host $http_host;
    proxy_set_header X-Forwarded-Proto https;
    proxy_set_header X-Forwarded-For $remote_addr;
    proxy_set_header X-Ssl-Authenticated $ssl_client_verify;
    proxy_set_header X-Ssl-User-Dn $ssl_client_s_dn;
    proxy_pass_header Server;
    proxy_redirect off;
    proxy_connect_timeout 10;
    proxy_read_timeout 10;
    proxy_pass http://localhost:8000/;
}
然后在django应用程序中,当使用SSL时,我得到了额外的头

在完成开发之后,我将应用程序部署到heroku,只是为了发现heroku本身正在进行SSL终止,并且没有通过证书。 在线搜索给了我一个结论,我无法用heroku实现这一点

因此,在我看来,我几乎没有选择:

  • 找到一个处理SSL终止的PaaS并给我报头
  • 找到一个可以让我自己处理SSL的PaaS,我需要找到一个新的PaaS提供者
  • 找到一个只提供我所需的SSL终止的提供商,然后proxy_pass将请求发送到我的heroku站点,但带有额外的头
  • 这类供应商有何建议? 如果我能找到这样一个供应商,在我还在开发阶段的时候给我提供免费软件包,这对我来说是一个很大的好处


    非常感谢您的帮助

    我相信,关于heroku的SSL终止问题,您是对的,并且有官方的答案。我相信您只需寻找另一台主机以这种方式实现它,或者在应用程序层进行身份验证。