journal features
movie reviews
photo of the day

Wordpress and nginx

the journal of Michael Werneburg

twenty-eight years and a million words

Toronto, 2013.05.27

So it turns out that the good folks that produce WordPress have done some naughty hard-coding of $_SERVER variables in their product. This means that if you're parking WordPress (e.g. under Apache/PHP) behind an nginx server, all of the references in the admin area to the local webserver will break. I don't know why, but this took me a full hour or so to track down. The offending bits use "$_SERVER['HTTP_HOST']". Madness.

I simply added this proxy headers to my nginx server, and all was well:

proxy_set_header Host $http_host;

I suppose the real moral of the story is that subdomains don't pick up the parent domain's proxy settings, but that would have required some thinking. Rrrr!

rand()m quote

When I let go of what I am, I become what I might be.

—Lao Tzu