WordPress Reverse Proxy Conditional

We’ve got a WordPress project that is setup to run through a reverse proxy. With this setup, we constantly have situations where we need to check whether or not we’re accessing the site from its primary URL or via the reverse proxy.

To do this, we set up a simple conditional to check the header for the appropriate “HTTP_X_FORWARDED_SERVER” and give the appropriate response based on that check.

Exit mobile version