C
C
cegthgtlhj2020-08-26 01:12:11
Nginx
cegthgtlhj, 2020-08-26 01:12:11

Why is a site on Ubuntu 20.04 + Nginx + Gunicorn visible only through IP, but Welcome to nginx comes out through the domain name?

Good afternoon
, I have a site on ubuntu 20.04 + Nginx + Gunicorn.
It works via IP address, but when typing the domain name, it only comes out "Welcome to NGINX!".
My Linux knowledge is near zero.
Please, help.
Here is the configuration.

Gunicorn systemd Service File
/etc/systemd/system/gunicorn.service

[Unit]
Description=gunicorn daemon
After=network.target

[Service]
User=oleg
Group=www-data
WorkingDirectory=/home/oleg/dj/ako
ExecStart=/home/oleg/dj/venv/bin/gunicorn --access-logfile - --workers 3 --bind unix:/home/oleg/dj/ako/ako.sock ako.wsgi:application

[Install]
WantedBy=multi-user.target


/etc/nginx/sites-available/ako
.
server {
    listen 80;
    server_name 95.xxx.xxx.62;

    location = /favicon.ico { access_log off; log_not_found off; }
    location /static/ {
        root /home/oleg/dj/ako/rsf/;
    }

    location / {
        include proxy_params;
        proxy_pass http://unix:/home/oleg/dj/ako/ako.sock;
    }
}


/home/oleg/dj/ako/ako
gunicorn.conf.py
bind = '127.0.0.1:8000'
workers = 3
user = "nobody"


/etc/supervisor/conf.d/
ako.conf

[program:ako]
command=/home/oleg/dj/venv/bin/gunicorn ako.wsgi:application -c /home/oleg/dj/ako/ako/gunicorn.conf.py

directory=/home/oleg/dj/ako

user=nobody
autorestart=true
redirect_stderr=true


Thanks

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
Andrey Barbolin, 2020-08-26
@dronmaxman

proxy_pass http://unix:/home/oleg/dj/ako/ako.sock;
Probably it should
proxy_pass http://127.0.0.1:8080;

C
cegthgtlhj, 2020-08-28
@cegthgtlhj

It looks like the problem was that I did not register the domain name in the Dzhangi config, but only registered the IP.
That is why the site worked through IP, but not through a domain name.
I am ashamed.
Thanks to everyone who helped.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question