why does domain name and ip address still show default nginx page but next level url directs to correct django view?
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?
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.