S
S
shtefff2019-04-26 18:17:00
Django
shtefff, 2019-04-26 18:17:00

500 error if accessed by domain name, how to treat?

Good afternoon!
I'm trying to make the nginx + gunicorn + django bundle work according to this tutorial
. If you access the site by IP, everything works. If through a domain name - produces Internal server error.
Error log nginx empty
Access log:
If accessed by ip:
109.252.51.23 - - [26/Apr/2019:10:40:20 -0400] "GET /static/img/democracy.jpg HTTP/1.1" 304 0 " http ://155.254.*.* /static/css/app.css" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/73.0.3683.86 Safari/537.36"
If by domain name:
109.252.51.23 - - [26/Apr/2019:10:40:25 -0400] "GET / HTTP/1.1" 500 141 "-" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML,
nginx settings

server {
    listen 80;
    listen [::]:80;

    server_name domain.com www.domain.com 155.254.*.*;

    location = /favicon.ico {
        access_log off;
        log_not_found off;
    }

    location /static/ {
        root /home/smartvote/smartvote;
    }

    location / {
        include proxy_params;
        proxy_pass http://unix:/run/gunicorn.sock;
    }
}

I would be very grateful for help. I’ve been suffering all day (
Google didn’t help.
I apologize if the design of the post is not correct.

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question