Django + Nginx + Gunicorn example.com有效,但www.example.com返回Bad Request(400)

时间:2015-10-07 15:39:07

标签: django nginx gunicorn

我试图访问www.example.com以及example.com工作正常,但它返回Bad Request 400:

Django的:

ALLOWED_HOSTS = ['librestock.com', 'www.librestock.com']

Nginx的:

server {
    listen 80;
    server_name librestock.com www.librestock.com;

    location = /favicon.ico { access_log off; log_not_found off; }
    location /static/ {
        root /home/david/StockSearch/stocksearch;
    }

    location / {
        include proxy_params;
        proxy_set_header        X-Real-IP       $remote_addr;
        proxy_set_header        X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_pass http://unix:/home/david/StockSearch/stocksearch/stocksearch.sock;
    }
}

有关调试和排除故障的任何想法吗?

0 个答案:

没有答案