My nginx droplet can be visited at ip and domain name

  • Posted on January 15, 2015
  • pkinchlaAsked by pkinchla

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?

Show comments

Submit an answer

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.

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.

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

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

server {
    listen 80;

    return 301 $scheme://$request_uri;