By bendonnaloia
Hi, My website has been down for 2 months, I’ve basically given up resolving this issue, I have been talking with DO support as well as posting on stackoverflow and nobody seems to be able to help me.
Setup: 1-click install of django, ubuntu, nginx
Issue: After setting up a domain, visiting that domain results in a 400 error. visiting the IP works with no problem. I purchased the domain using Google Domains and used the custom name server option and put:
ns1.digitalocean.com ns2.digitalocean.com ns3.digitalocean.com
In etc/nginx/sites-available/django I 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;
# Your Django project's media files - amend as required
location /media {
alias /home/django/django/dealr/dealr/media;
}
# your Django project's static files - amend as 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 this file symlinked inside etc/nginx/sites-enabled.
Another thing that may be worth noting is even though I get a 400 error when visiting the domain, it still loads the favicon.
Any ideas or help would be appreciated.
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
thank you !! that last line of code in the settings file that shipped with the one click install killed me.
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.
New accounts only. By submitting your email you agree to our Privacy Policy
Scale up as you grow — whether you're running one virtual machine or ten thousand.
Sign up and get $200 in credit for your first 60 days with DigitalOcean.*
*This promotional offer applies to new accounts only.