我正在從 Django 專案在 AWS 上設定服務器,當嘗試從 HTTP 切換到 HTTPS 時,我的 Nginx 出現錯誤。查看我的檔案:
host = fantasy name
server {
listen 80;
server_name host;
return 301 https://host$request_uri;
location = /favicon.ico { access_log off; log_not_found off; }
location /staticfiles/ {alias /home/ubuntu/Filmes/staticfiles/;}
location / {
include proxy_params;
proxy_pass http://unix:/run/gunicorn.sock;
}
}
事實上,當通過 HTTP 使用舊域時,我被重定向到 HTTPS,但我得到了CONNECTION DENIED TO THIS DNS.
uj5u.com熱心網友回復:
要打開HTTPS并通過 HTTPS 訪問您的站點,您需要一個SSL/TLS位于 Web 服務器上的證書。您可以從免費的 Let's Encrypt等證書頒發機構 (CA) 獲得證書
轉載請註明出處,本文鏈接:https://www.uj5u.com/qukuanlian/511176.html
標籤:djangonginx
