我做我自己的配置爲我的Web服務器,如果我通過IP訪問我的網站,一切都可以正常使用 - http://179.188.3.54壞請求(400)和Django
我沒有改變我的域名還沒有,我修改/ etc/hosts中的本地這樣的:
179.188.3.54 cinegloria.com
所以,當我嘗試訪問我的網站上我的瀏覽器我得到錯誤的請求(400)。這裏是我的nginx的配置:
server {
listen 80 default_server;
listen [::]:80 default_server ipv6only=on;
root /usr/share/nginx/www;
index index.html index.htm;
access_log /var/log/nginx/domain-access.log;
error_log /var/log/nginx/error.log;
server_name cinegloria.com www.cinegloria.com;
location /static {
alias /cinegloria/cinegloria/cinegloria/static/;
}
location/{
proxy_pass_header Server;
proxy_set_header Host $http_host;
proxy_redirect off;
proxy_set_header X-Forwarded-For $remote_addr;
proxy_set_header X-Scheme $scheme;
proxy_connect_timeout 10;
proxy_read_timeout 10;
proxy_pass http://0.0.0.0:8000/;
fastcgi_split_path_info ^()(.*)$;
}
}
我不知道什麼可以是錯誤的,據我知道我沒有改變任何東西。有任何想法嗎?
我試了兩個,我仍然有同樣的問題.. – Lara 2015-02-24 13:55:28
更新與捲曲輸出。這就像你有錯誤的端口。你如何運行Django? python manage.py runserver 0.0.0。0:8000 – 2015-02-24 15:48:11
我加了ALLOWED_HOSTS鏈接 – 2015-02-24 15:54:52