构建我的 django 应用程序后,我让它通过 http 工作。使用 certbot 安装 ssl 证书后出现此问题。现在,不再提供静态文件。
这是我的 nginx 配置
server {
server_name pythonyard.com www.pythonyard.com *.pythonyard.com;
location /static/ {
alias /home/kenechukwu_webapp/allpython/backend/;
}
location / {
proxy_pass http://localhost:8000;
}
listen 443 ssl; # managed by Certbot
ssl_certificate /etc/letsencrypt/live/pythonyard.com/fullchain.pem; # managed by Certbot
ssl_certificate_key /etc/letsencrypt/live/pythonyard.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.pythonyard.com) {
return 301 https://$host$request_uri;
} # managed by Certbot
if ($host = pythonyard.com) {
return 301 https://$host$request_uri;
} # managed by Certbot
listen 80;
server_name pythonyard.com www.pythonyard.com *.pythonyard.com;
return 404; # managed by Certbot
}
我在 stackoverflow 上读过很多类似的问题,但没有一个对我有用。请问可能出什么问题了?这是我第一次使用它