Wordpress and nginx

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!

leave a comment

By submitting this form you agree to the privacy terms.

rand()m quote

(In which I leave the final word to someone else.)

There is no security upon this earth. There is only opportunity.

-Douglas MacArthur