Report this

What is the reason for this report?

Nginx pointing to django project via domain name, but pointing to default nginx page via IP

Posted on February 22, 2020

I have the following in /etc/nginx/sites-available/jobzumo:

server{
        listen 80;
        server_name 'jobzumo.com';
        location = /favicon.ico { access_log off; log_not_found $
        location /static/ {
        root /home/justin/project;
        }
        location / {
                include proxy_params;
                proxy_pass http://unix:/run/gunicorn.sock;
        }
}

If I visit jobzumo.com, I will see the default django rocket ship and everything is working fine. If I visit my IP I will see the default ‘welcome to nginx’ page. If I change the server_name to my IP instead of the ‘jobzumo.com’ domain name, the opposite will happen(Rocket ship at IP, welcome to nginx at domain). Does anyone know how to get both the IP and domain name to point at my django project?

The developer cloud

Scale up as you grow — whether you're running one virtual machine or ten thousand.

Start building today

From GPU-powered inference and Kubernetes to managed databases and storage, get everything you need to build, scale, and deploy intelligent applications.