greens356
By:
greens356

Show domain name instead of IP address using nginx

June 16, 2015 3.8k views
Nginx

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

1 Answer
  • 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.

Have another answer? Share your knowledge.