Easily configure a performant, secure, and stable NGINX server.Learn More
How to Redirect Droplet IP Access to Domain URL
I followed DO’s tutorial (https://www.digitalocean.com/community/tutorials/how-to-install-wordpress-with-lemp-on-ubuntu-18-04) along with all the pre-requisites which also include securing Nginx with Certbot.
My domain is properly being redirected from HTTP-to-HTTPS. No problem at that end.
Now, I have a few questions:
I can’t access my website through my Droplet IP (it serves 404). If I add HTTPS to the droplet IP, it shows the following and if I proceed, I can access the website.
First question: Why is this happening?
Second question: I want to redirect my droplet’s IP access to my actual domain URL (both when using HTTP and HTTPS). How can I do this?
Following is my default config file:
It’d be great if someone could help me, I tried looking up and did find some solutions by creating a new server block, but that didn’t fit my current defined server blocks.
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.×