Title: WordPress behind reverse proxy
Last modified: August 20, 2016

---

# WordPress behind reverse proxy

 *  Resolved [arodessa](https://wordpress.org/support/users/arodessa/)
 * (@arodessa)
 * [14 years, 10 months ago](https://wordpress.org/support/topic/wordpress-behind-reverse-proxy-1/)
 * Hello,
 * First of all I’m running the latest version of wordpress and I have read what
   I believe are all the posts on the support forums about this issue, but I’m unable
   to resolve it for myself.
 * The setup:
 * wordpress is installed on firewalled internal server [http://some.domain.com:12345/wordpress](http://some.domain.com:12345/wordpress)
 * public proxy server is on [http://some.example.com/home](http://some.example.com/home)
 * The redirect happens as expected, however, all the images (theme layout) and 
   css doesn’t show up to the outside world because wordpress is using the absolute
   path to the images (i.e. some.domain:12345) which is not accessible from outside
   the firewall.
 * To solve this I have tried setting site/wordpress url from admin site to various
   values…with no success, since after the change I could no longer login to the
   admin side even internally — so I reverted this change.
 * I have tried editing _SERVER[‘HTTP_HOST’] variable in wp-config: at best I get“
   [http://some.example.com:12345/wordpress&#8221](http://some.example.com:12345/wordpress&#8221);
   when I try to access wordpress from the public proxy, which obviously doesn’t
   work. At least the internal url still works.
 * I’ve tried going through the individual php files and modifying REMOTE_ADDR to
   HTTP_X_FORWARDED_HOST, that really did not help so I reverted this change. I 
   get infinite redirect problem, which I’ve also read about. I’ve set ProxyPreserveHost
   on, which doesn’t seem to have had a positive effect.
 * I’ve RTFM about the _SERVER variable, and tried to play with other pieces of 
   it with no success.
 * My problem might be that I’m using piecemeal knowledge to solve this issue and
   turning “switches” on and off blindly. A lot of the forum posts address a specific
   part, but there is nowhere that I’ve found that provides a global solution. (
   Let me know if you need more detail about any of the specific solutions I’ve 
   tried.)
 * Any help is appreciated.

Viewing 3 replies - 1 through 3 (of 3 total)

 *  Thread Starter [arodessa](https://wordpress.org/support/users/arodessa/)
 * (@arodessa)
 * [14 years, 10 months ago](https://wordpress.org/support/topic/wordpress-behind-reverse-proxy-1/#post-2200826)
 * In hopes other ppl find this helpful, here’s how I resolved my issue
 * in wp-config.php, aside from the lines:
    $_SERVER[‘HTTP_HOST’] = $_SERVER[‘HTTP_X_FORWARDED_HOST’];
   define(‘WP_HOME’, ‘[http://some.example.com/home](http://some.example.com/home);
   define(‘WP_SITEURL’, ‘[http://some.example.com/home&#8217](http://some.example.com/home&#8217););
 * I also added:
 * $_SERVER[‘REQUEST_URI’] = str_replace(“wordpress”, “home”,
    $_SERVER[‘REQUEST_URI’]);
 * This made all the css and images show up correctly.
 *  [WhiteWolfC](https://wordpress.org/support/users/whitewolfc/)
 * (@whitewolfc)
 * [14 years, 9 months ago](https://wordpress.org/support/topic/wordpress-behind-reverse-proxy-1/#post-2200971)
 * Thanks arodesa!
 *  [lruellan](https://wordpress.org/support/users/lruellan/)
 * (@lruellan)
 * [14 years, 7 months ago](https://wordpress.org/support/topic/wordpress-behind-reverse-proxy-1/#post-2200999)
 * Thank you so much!!! This saved my day. I had been stuck trying to figure this
   out for hours.

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘WordPress behind reverse proxy’ is closed to new replies.

## Tags

 * [HTTP_HOST](https://wordpress.org/support/topic-tag/http_host/)
 * [redirect](https://wordpress.org/support/topic-tag/redirect/)
 * [reverse proxy](https://wordpress.org/support/topic-tag/reverse-proxy/)

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 3 replies
 * 3 participants
 * Last reply from: [lruellan](https://wordpress.org/support/users/lruellan/)
 * Last activity: [14 years, 7 months ago](https://wordpress.org/support/topic/wordpress-behind-reverse-proxy-1/#post-2200999)
 * Status: resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
