By tangrandy
after i registered a domain name and tied the domain name to my droplet’s ip address, i waited to see if the domain name would be active and show the correct django view which would be called with a url pattern specified as an empty python string ‘’. shortly after registering the domain name, i used the droplets ip address in the browser as i knew it would take a while for my new domain name to propagate. using just the droplet’s ip address correctly called the appropriate django view that is called when the url matches a pattern of an empty python string ‘’. but later on when i tried typing in my domain name, the default nginx page appeared. then the same thing happened when i tried using the droplets ip address even though it had worked a little earlier. but then when i changed my django projects url.py file to match a more specific url i.e ‘stats/’ instead of the empty python string ‘’, using the domain name (www.jedistats.com/stats) and the droplets ip address with /stats appended, it worked. why isnt nginx passing the empty url/plain domain name/ip address to the view that’s tied to the empty python string ‘’ url pattern?
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!
lol, never mind. i figured out the answer. so i totally forgot that prior to tying a domain name to my droplet, i had already configured/enabled nginx to route to this other django project i was working on but abandoned and i forgot to rm the symlink to that old site. so when i added a new nginx site, the server_name was for an ip address that was also in another conf. and if the url isn’t specific enough, i guess nginx will just default to nginx page.
This comment has been deleted
This comment has been deleted
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.
New accounts only. By submitting your email you agree to our Privacy Policy
Scale up as you grow — whether you're running one virtual machine or ten thousand.
Sign up and get $200 in credit for your first 60 days with DigitalOcean.*
*This promotional offer applies to new accounts only.