I recently used the Deploying to VPS Railscasts by Ryan Bates for one of my projects. Everything worked like a charm however there is one small issue which is bugging me regarding the nginx configuration. For some reason whenever I enter the staging enviornment domain it shows the right page but gets redirected to an IP instead of showing the domain.
For example if the domain is example.com it gets redirected to xx.xx.xxx.xx which is the IP address of the server.
Can anyone help me resolving this. I have tried several online sources but none of them seems to work. Most of the time I just end up having nginx in infinite loop creating redirects.
Thanks