Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/django/24.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
Python 如何使用本地服务器的nginx将http转换为https(自签名cetificate)_Python_Django_Ssl_Nginx_Uwsgi - Fatal编程技术网

Python 如何使用本地服务器的nginx将http转换为https(自签名cetificate)

Python 如何使用本地服务器的nginx将http转换为https(自签名cetificate),python,django,ssl,nginx,uwsgi,Python,Django,Ssl,Nginx,Uwsgi,我试图在nginx内部将http转换为https安全,为此,我在nginx conf文件中创建并添加了自签名证书 server { listen 80; server_name www.local.com; rewrite ^ https://$server_name$request_uri? permanent; } server { listen 443; server_name www.local.com; ssl on; ssl_

我试图在nginx内部将http转换为https安全,为此,我在nginx conf文件中创建并添加了自签名证书

server {
   listen 80;
   server_name www.local.com;
   rewrite        ^ https://$server_name$request_uri? permanent;
}
server {
   listen  443;
   server_name www.local.com;
   ssl on;
   ssl_certificate /etc/ssl/self_signed_certificate.crt;
   ssl_certificate_key /etc/ssl/self_signed_certificate.key;
}
现在,当我给出url时,它会从http重定向到https。并在crome中显示Message站点安全证书不受信任。当我点击继续。我得到SSL连接错误。它在http上工作得非常好。如何使用https运行我的本地网站


我使用的是uwsgi服务器,网站是python-Django。我犯了什么错误或者我必须做什么?请帮忙。提前感谢,对不起,我讲的是英语。

您收到的消息是因为您使用的是自签名证书,您需要使用来自可信提供商的SSL证书以避免警告。您可以获得一个免费的SSL证书,该证书受到大多数主要浏览器的信任。您可以看到所有受支持的浏览器。

此问题似乎属于Stack Exchange网络中的另一个站点,因为它与编程无关。也许是。