why my domain is not working in nginx, django?


  1. i purchesd new domain like in nextraone hosting services .

  2. then i replaced the servername space to ns1,2,3 digital ocean

  3. i checked the “” where my new domain server point to old or new NS

  4. its pointing to new digital ocean NS my :$ nano /etc/nginx/sites-available/hello i changed ip address to domain name

    listen 80;

    # add here the ip address of your server
    # or a domain pointing to that ip (like or
   #server_name my ip address;

    keepalive_timeout 5;
    client_max_body_size 4G;

  1. in django file added domain name in allowed host like this ALLOWED_HOSTS = [‘’,‘localhost’,‘’,‘’]

  2. but is not working now with domain name instead of ip address

Show comments

Submit an answer

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!

Sign In or Sign Up to Answer

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.

Accepted Answer

trail and error i solved

This comment has been deleted

    Prakash Jha
    DigitalOcean Employee
    DigitalOcean Employee badge
    March 7, 2019

    Hey there! I am not exactly sure how you have configured nginx blocks but the first thing I have noticed is your Domain is not resolving to any IP. This is because you have added the domain on DigitalOcean account but haven’t added any A record and CNAME for the domain.

    Please add an A record for to and a CNAME record for Is AN alias of

    Keep me posted on how it goes after the DNS correction.

    Try DigitalOcean for free

    Click below to sign up and get $200 of credit to try our products over 60 days!

    Sign up

    Featured on Community

    Get our biweekly newsletter

    Sign up for Infrastructure as a Newsletter.

    Hollie's Hub for Good

    Working on improving health and education, reducing inequality, and spurring economic growth? We'd like to help.

    Become a contributor

    Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.

    Welcome to the developer cloud

    DigitalOcean makes it simple to launch in the cloud and scale up as you grow — whether you're running one virtual machine or ten thousand.

    Learn more
    DigitalOcean Cloud Control Panel