NginX and WordPress OpenID Plugin

Send to Kindle

I normally have super powers when it comes to persevering through annoying technical problems. On rare occasions, Kryptonite appears out of nowhere and strips me of those powers.

This blog is powered by WordPress.org software. I use a variety of plugins to make my life a bit easier. One of my favorites is the OpenID WordPress Plugin. I’ve been using it since it first came out and I’m very happy with it.

Because I was using it from the beginning, I lived through a few rough upgrades (not complaining, just explaining). The problems always got sorted out quickly.

Back in June 2008 (yes, a long time ago), I switched from Apache to NginX and have never looked back. The trickiest part of switching a WordPress site (especially WordPress MU, even more so with BuddyPress installed!) is converting the Rewrite Rules that are typically stored in a .htaccess file into nginx syntax.

While I got my initial attempt to work, I’ve grown way more comfortable and familiar with nginx over the past year, and I’ve tweaked my rewrite rules quite a bit.

Along the way, there were numerous updates of the OpenID Plugin as well. Most times things just kept working. Once, OpenID stopped working, and I tried to track it down. I gave up pretty quickly because I had seen that behavior before with an individual update of the plugin. Sure enough, the next update got me working again.

Then at some point, it stopped again. At this point I had conditioned myself to ignore it, and I went back to logging in with a password (something I really prefer not to do). This lasted for months. At some point, the plugin got updated at least twice, and things still didn’t work for me. Now I was getting annoyed.

I stopped trying to use OpenID. Two days ago I tried again, I can’t explain why. I got a strange Google Toolbar redirect error message. I did a search, and someone was complaining about something that looked similar, but had nothing to do with WordPress. A Google employee responded to him that he should temporarily disable the Toolbar (in Firefox) and see if the problem went away.

I decided to try that and instead of a strange Google error, I simply got a 404. What? A simple 404 couldn’t be the plugin’s fault. Time to dig in (finally).

I turned on nginx debugging and tried to log in. I was shocked when I saw that the error had nothing to do with the plugin. Instead, my nginx rules weren’t even calling in to PHP to let the plugin do its work.

Without a doubt, I had an error in one of my rewrite rules in nginx. There’s a possibility that at some point, the plugin changed the way it redirects, so that it was a combination of a new URL coming back to me (that I wasn’t catching correctly) or simply one of my changes in nginx, without the plugin doing anything different.

I added a new rule and was able to log in (for the first time in over six months!) via OpenID.

In this case, I let my own normal persistence fade, because I incorrectly assumed that the problem was contained in the plugin. Shame on me!