使用Let's Encrypt将CertBot证书添加到我的网站后
尝试访问我的网站域时,我得到ERR_TOO_MANY_REDIRECTS
。
一些信息:
-使用django,nginx和gunicorn构建的mywebsite。
server {
server_name www.mydomain.com mydomain.com;
location = /favicon.ico { access_log off; log_not_found off; }
location /static/ {
root /home/myproject;
}
location / {
include proxy_params;
proxy_pass http://unix:/run/gunicorn.sock;
}
listen 443 ssl; # managed by Certbot
ssl_certificate /etc/letsencrypt/live/mydomain.com/fullchain.pem; # managed by Certbot
ssl_certificate_key /etc/letsencrypt/live/mydomain.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.mydomain.com) {
return 301 https://$host$request_uri;
} # managed by Certbot
if ($host = mydomain.com) {
return 301 https://$host$request_uri;
} # managed by Certbot
listen 80;
server_name www.mydomain.com mydomain.com;
return 404; # managed by Certbot
}
请告诉我是否需要其他代码/信息 谢谢
注意:我已经阅读了所有具有相同问题的问题,但我仍然不知道出什么问题了