解决方法
settings.py
设置一个包含两个元素的元组——要查找的头的名称和所需的值:
Nginx 配置
HTTPS server
server {
listen 443 ssl;
server_name www.gaoyuanqi.cn;
...
location / {
# 转发地址
proxy_pass http://127.0.0.1:8000;
proxy_redirect off;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-Proto https;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $http_x_forwarded_proto;
}
}
重启nginx