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

Posted February 22, 2020 2.4k views

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

        listen 80;
        server_name '';
        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, 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 '’ 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?

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.

Submit an Answer
1 answer


I can see that your website is already loading the Django installation. Would you mind sharing with the community how you solved the problem?

I believe that a possible issue that could be causing the problem is the server_name part in your configuration file, I would recommend not using quotes there.


  • I didn’t solve my problem. If you visit the domain( you will see the django installation. But if you go to the IP address you will see the default ‘welcome to nginx’ page. I don’t think this is supposed to happen?

    • Hi there @justinobrien76981,

      I believe that this is because you have 2 Nginx Server blocks: one for your domain name and a default server block.

      If you would like to see your Django app when visiting your IP address as well, what you need to do is to copy your reverse proxy settings from your domain name’s server block and add them to your /etc/nginx/sites-enabled/default config as well.

      Hope that this helps!