Report this

What is the reason for this report?

My nginx droplet can be visited at ip and domain name

Posted on January 15, 2015

I have tried few things and I am unable to have my ip redirect to my domain name. I tried redirecting in my sites-available but it breaks all my permalinks. Any ideas?



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!

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.

Much like rewrite you are doing from www.yourname.com to yourname.com, you need to set a redirect from the IP to the domain name. You can use something like:

server {
    listen 80;
    server_name 111.11.111.111;

    return 301 $scheme://yourname.com$request_uri;
}

Yes you will have to create a new server block in the config file just to redirect/resolve IP address to domain name Works good now thanks

The developer cloud

Scale up as you grow — whether you're running one virtual machine or ten thousand.

Get started for free

Sign up and get $200 in credit for your first 60 days with DigitalOcean.*

*This promotional offer applies to new accounts only.