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.)

It has always seemed strange to me...The things we admire in men, kindness and generosity, openness, honesty, understanding and feeling, are the concomitants of failure in our system. And those traits we detest, sharpness, greed, acquisitiveness, meanness, egotism and self-interest, are the traits of success. And while men admire the quality of the first they love the produce of the second.

-John Steinbeck, Cannery Row