Report this

What is the reason for this report?

Error setting up Flask app - domain returns nginx page: "Further configuration required"

Posted on November 8, 2015

Hi all,

I have my Flask test app from the tutorial up and running, it works well on my IP, I’m super happy about that.

However I have bought a Domain name www.trounceem.co.uk and pointed it at my IP 46.101.73.179 however I get a Nginx splash screen saying my server needs setting up.

its this splash screen: Welcome to nginx! If you see this page, the nginx web server is successfully installed and working. Further configuration is required

Is this something I need to change on my droplet or is it somethign I need to take to my Domain provider??

Thanks in advance for helping a noob.



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.

I’m also seeing this message. Is there a walk-through of how to debug this?

What do you currently have in your nginx configuration? On ubuntu the config file for the server blocks you are hosting would be in /etc/nginx/sites-enabled/

Heya all,

You need to create a reverse proxy with Nginx.

  1. Create or edit your NGINX configuration file: This file is typically located in /etc/nginx/sites-available/. You can create a new file specific for your Django project. For instance, your_project.conf.

  2. Basic Configuration:

    • Start with defining the server block.
    • Set the listen directive to the port you want NGINX to listen on, commonly 80 for HTTP.
    • Use the server_name directive to define your domain or IP address.
    • Define the location block to pass requests to your Django application server.
  3. Static and Media Files:

    • Django serves its static and media files separately, so you need to configure NGINX to handle these files efficiently.
  4. Security and Performance Enhancements (optional):

    • You might also want to add headers for security, enable gzip for compression, and other performance-related settings.

Here is a simplified example of what the NGINX configuration file (your_project.conf) might look like:

server {
    listen 80;
    server_name example.com www.example.com;  # Replace with your domain name

    location = /favicon.ico { access_log off; log_not_found off; }
    location /static/ {
        root /path/to/your/mysite;  # Replace with your Django project's root directory
    }

    location /media/ {
        root /path/to/your/mysite;  # Replace with your Django project's root directory
    }

    location / {
        proxy_pass http://localhost:8000;  # Assuming Django runs on the 8000 port
        proxy_set_header Host $host;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header X-Forwarded-Proto $scheme;
    }

    # Optional: Security and Performance enhancements
    # add_header X-Frame-Options SAMEORIGIN;
    # add_header X-Content-Type-Options nosniff;
    # add_header X-XSS-Protection "1; mode=block";
    # gzip on;
    # gzip_types text/plain text/css application/json application/javascript text/xml application/xml application/xml+rss text/javascript;
}

Important Notes:

  • Replace /path/to/your/mysite with the actual path to your Django project.
  • The proxy_pass directive should point to the host and port where your Django app server (like Gunicorn) is running.
  • After configuring, create a symbolic link of this file in /etc/nginx/sites-enabled/.
  • Test the NGINX configuration using sudo nginx -t.
  • Reload or restart NGINX to apply the changes.

Remember, this is a basic setup and might need adjustments based on your specific requirements, like handling HTTPS, more complex routing, load balancing, etc.

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.