我有一个运行在NGINX上的django应用程序,并成功创建了ssl证书,当我运行网络时,它超时了,并且启用了端口443。
server {
server_name example.com www.example.com;
access_log off;
location / {
proxy_pass https://127.0.0.1:8000;
proxy_set_header X-Forwarded-Host $server_name;
proxy_set_header X-Real-IP $remote_addr;
add_header P3P 'CP="ALL DSP COR PSAa PSDa OUR NOR ONL UNI COM NAV"';
}
listen 443 ssl; # managed by Certbot
ssl_certificate /etc/letsencrypt/live/example.com/fullchain.pem; # managed by Certbot
ssl_certificate_key /etc/letsencrypt/live/example.com/privkey.pem; # managed by Certbot
include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot
ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot
}
server {
if ($host = www.example.com) {
return 301 https://$host$request_uri;
} # managed by Certbot
if ($host = example.com) {
return 301 https://$host$request_uri;
} # managed by Certbot
server_name example.com www.example.com;
listen 80;
return 404; # managed by Certbot
}
这是上面显示的/ etc / nginx / sites-available / mysite并正在运行sudo ufw状态输出
Status: active
To Action From
-- ------ ----
Apache Full ALLOW Anywhere
8000 ALLOW Anywhere
Nginx Full ALLOW Anywhere
443/tcp ALLOW Anywhere
80/tcp DENY Anywhere
22/tcp ALLOW Anywhere
22 ALLOW Anywhere
443 ALLOW Anywhere
80 ALLOW Anywhere
80 on eth0 ALLOW Anywhere
Apache Full (v6) ALLOW Anywhere (v6)
8000 (v6) ALLOW Anywhere (v6)
Nginx Full (v6) ALLOW Anywhere (v6)
443/tcp (v6) ALLOW Anywhere (v6)
80/tcp (v6) DENY Anywhere (v6)
22/tcp (v6) ALLOW Anywhere (v6)
22 (v6) ALLOW Anywhere (v6)
443 (v6) ALLOW Anywhere (v6)
80 (v6) ALLOW Anywhere (v6)
80 (v6) on eth0 ALLOW Anywhere (v6)
为什么我的网站没有显示https?我在哪里配置错误?