my face
About Me

Published Posts

All Posts

New Post


View by Tag:

interviewing, code, testing, philosophy, blog, wantmyjob, virtualization, railsmud, heroku, ruby, published, neoarchaeology, railsgame, rails, juggernaut, astrino, cheaptoad, shannaspizza, mongodb, refactorit, devise, rvm, passenger, jruby, programming, vagrant, chef, railsframe, business, codefolio


Online Portfolio

Resume

Profile on LinkedIn

Recommend me on WorkingWithRails: Recommend Me

Deploying with NGinX (redux)

Posted: 2 years ago (2009-04-21 20:05:44 UTC )

NGinX was giving me some weird problems with OpenID because it was redirecting to an odd hostname. If your server uses OpenID as a consumer, then a user gives your site their OpenID identifier in some way. Then, your site uses that identifier as part of a request to the site. You can pass a "return_to" parameter to the OpenID library (ruby-openid, used via the Rails open_id_authentication plugin in my case), and it'll bounce back to your site. No problem, right?

Sadly, yes, problem. It turns out that if your hostname or DNS stuff is set up in an odd way, it doesn't much matter what you set the return_to parameter to be. When you're using NGinX (and perhaps any reverse proxy?), you'll wind up getting redirected to whatever the server thinks its name is. I have no idea why. In my case, that was "http://arch", which of course doesn't resolve to anything useful on most machines.

I changed /etc/hostname and rebooted, and everything seemed better. Now my machine has www.<myurl>.com as its hostname, and the redirect works everywhere I've tried it. Good stuff.

Previous: Deploying with NGinX / Next: A Quick Look Under the Rails

Edit | Destroy | See All Posts

blog comments powered by Disqus