Report this

What is the reason for this report?

Show domain name instead of IP address using nginx

Posted on June 16, 2015

Hello,

I am using nginx and I have a website I am building. When I load my website using the domain name, it then switches the domain name to the IP address in the address bar after my site loads. I know I need to change a setting in a file somewhere in order for the site to display (and keep the domain displayed) instead of showing the IP but I can not figure it out for the life of me.

I am using the latest nginx release and CentOS 6.5.

Any help?

Thanks.

Justin



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.
  • it then switches the domain name to the IP address in the address bar after my site loads*

This is almost certainly due to the software you are running on top of nginx performing a redirect to it’s configured location. For instance, Wordpress will do this if the site name and base URL are set to the IP address rather than the domain name (which will happen automatically if you perform the setup via the IP address. These settings (on wordpress) can be changed via the /wp-admin panel.

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.