400 error, nginx debug log confusion, Django app

8 views
Skip to first unread message

Tom Tanner

unread,
May 11, 2018, 12:22:11 PM5/11/18
to Django users
Note: `mydomain.com` is not my real domain name.

When I go to `test.mydomain.com`, I get a page that just says `Bad Request (400)`. 

I'm running a Django app located at `/home/django/product_blog`.

Here are the contents of my nginx file at `/etc/nginx/sites-available/BRBR2`.

    server {
        listen 80;
        server_name test.mydomain.com;
        error_log /var/log/nginx/debug.log debug;
    
        location = /favicon.ico { access_log off; log_not_found off; }
        location /static/ {
            root /home/django/product_blog;
        }
    
        location / {
            include         uwsgi_params;
            uwsgi_pass      unix:/home/django/product_blog/product_blog.sock;
        }
    }

When I go to the debug file after trying to load the site, I see this: https://pastebin.com/GchPd1MD.

The file at `/var/log/nginx/error.log` shows nothing.

How do I find the source of the 400 error?

Tom Tanner

unread,
May 11, 2018, 12:48:54 PM5/11/18
to Django users
I ran `sudo reboot` and `sudo service nginx configtest && sudo service nginx restart`. Now the site loads just fine. I don't know which of those two commands did it.
Reply all
Reply to author
Forward
0 new messages