Proxy-set-header: Forwarding HTTP headers from Nginx to a WordPress container

I detailed in a recent post how I got a working WordPress container setup, complete with database and PHP engine. I saved the bit about how to redirect traffic to the container (and apply encryption to the outbound connections) because I knew it was going to be just as much work as getting the setup running. Also I needed to first get up to speed on HTTP headers in general and how to inspect them specifically.

This post is not a how-to any more than it’s a how-not-to. I wanted to detail as much the attempts that did not work as the final one that did because the former were just as illuminating as the latter.


Playing fast(cgi) and loose

Problem: On all my non-https enabled WordPress sites, the links to CSS and images were always https which meant they failed, rendering as pure html. Assumption: It’s either a WordPress or an nginx issue. Solution: Turns it it was neither but a bad fastcgi parameter. Lesson: Kids, don’t copy-paste fastcgi parameters.