Question

Using Ubuntu 20.04, Nginx, Gunicorn, and Django. Can't get domain to work.

Posted November 20, 2020 96 views
NginxDjangoUbuntu 20.04

I followed the tutorial here and seemed to have everything working: https://www.digitalocean.com/community/tutorials/how-to-set-up-django-with-postgres-nginx-and-gunicorn-on-ubuntu-20-04

The IP works fine, no errors with nginx, no errors with gunicorn, but my domain just won’t work.

Sites available:

server {
    listen 80;
    server_name tabletopadmiral.com www.tabletopadmiral.com 167.99.5.101;

    location = /favicon.ico { access_log off; log_not_found off; }
    location /static/ {
        root /home/andrewi/tta;
    }

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

gunicorn.service:

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

[Service]
User=andrewi
Group=www-data
WorkingDirectory=/home/andrewi/tta
ExecStart=/home/andrewi/tta/tta/bin/gunicorn \
          --access-logfile - \
          --workers 3 \
          --bind unix:/run/gunicorn.sock \
          tta.wsgi:application

[Install]
WantedBy=multi-user.target

gunicorn.socket:

[Unit]
Description=gunicorn socket

[Socket]
ListenStream=/run/gunicorn.sock

[Install]
WantedBy=sockets.target

Any help would be appreciated.

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

×
1 answer

Hi Bro, I checked your website is working fine.

Submit an Answer