不确定我做错了什么,但我试图仅使用 https 通过 nginx 获取 gunicorn/django。这是我的 nginx 配置:
upstream app_server {
server unix:/srv/django/app/run/gunicorn.sock fail_timeout=0;
}
server {
listen 80;
return 301 https://$host$request_uri;
}
server {
listen 443;
server_name app.mydomain.com;
ssl on;
ssl_certificate /etc/nginx/ssl/nginx.crt;
ssl_certificate_key /etc/nginx/ssl/nginx.key;
client_max_body_size 4G;
access_log /srv/django/app/logs/nginx-access.log;
error_log /srv/django/app/logs/nginx-error.log;
location /static/ {
alias /srv/django/app/data/static/;
}
location /media/ {
alias /wrv/django/app/data/media/;
}
location / {
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto https;
proxy_set_header Host $http_host;
proxy_pass http://app_server;
}
}
我在 上收到 400 错误app.mydomain.com
,但应用程序已在 上发布mydomain.com
。我的配置有错误吗?