Report this

What is the reason for this report?

Get Welcome to nginx page with my django web project

Posted on September 24, 2017

I am using “one-click” django set up. Website was working fine last week, but I found it cannot redirect to my home page anymore today. It shows: “Welcome to nginx! If you see this page, the nginx web server is successfully installed and working. Further configuration is required.” After searching on old questions, I looked at my “default” file under /etc/nginx/sites-available directory, it already has “root /var/www/html;”. I tried to set listen port to 8080 as well, but it did not work. I do not know what to do now, anyone can help please?



This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

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.

Hi there,

It sounds like that the Nginx server block does not contain the required reverse proxy rules to forward the traffic to your Django app as described here:

https://www.digitalocean.com/community/tutorials/how-to-set-up-django-with-postgres-nginx-and-gunicorn-on-ubuntu-18-04

Example:

server {
    listen 80;
    server_name server_domain_or_IP;

    location = /favicon.ico { access_log off; log_not_found off; }
    location /static/ {
        root /home/sammy/myproject;
    }

    location / {
        include proxy_params;
        proxy_pass http://unix:/home/sammy/myproject/myproject.sock;
    }
}

Best,

Bobby

The developer cloud

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

Get started for free

Sign up and get $200 in credit for your first 60 days with DigitalOcean.*

*This promotional offer applies to new accounts only.