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
Answer a question...

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

Want to learn more? Join the DigitalOcean Community!

Join our DigitalOcean community of over a million developers for free! Get help and share knowledge in Q&A, subscribe to topics of interest, and get courses and tools that will help you grow as a developer and scale your project or business.

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.