nginx - Why am I getting a 400 Bad Request error when visiting domain? -
my website has been down 2 months, i've given resolving issue, have been talking support posting on stackoverflow , nobody seems able me.
setup: digital ocean 1-click install of django, ubuntu, nginx
issue: after setting domain, visiting domain results in 400 error. visiting ip works no problem. purchased domain using google domains , used custom name server option , put:
ns1.digitalocean.com ns2.digitalocean.com ns3.digitalocean.com
in etc/nginx/sites-available/django have:
upstream app_server { server 127.0.0.1:9000 fail_timeout=0; } server { listen 80 default_server; listen [::]:80 default_server ipv6only=on; root /usr/share/nginx/html; index index.html index.htm; client_max_body_size 4g; server_name cannablr.com www.cannablr.com; keepalive_timeout 5; # django project's media files - amend required location /media { alias /home/django/django/dealr/dealr/media; } # django project's static files - amend required location /static { alias /home/django/django/dealr/dealr/static; } location /favicon.ico { alias /home/django/django/dealr/favicon.ico; } location / { proxy_set_header x-forwarded-for $proxy_add_x_forwarded_for; proxy_set_header host $http_host; proxy_redirect off; proxy_pass http://app_server; } }
i have file symlinked inside etc/nginx/sites-enabled.
another thing may worth noting though 400 error when visiting domain, still loads favicon. no errors in error log (error logging configured)
any ideas or appreciated.
try add thisallowed_hosts = ("yourdomain.com",)
Comments
Post a Comment