{"id":2200386,"date":"2011-07-21T15:30:57","date_gmt":"2011-07-21T15:30:57","guid":{"rendered":"https:\/\/wordpress.org\/support\/topic\/wordpress-behind-reverse-proxy-1\/"},"modified":"2016-08-20T01:35:48","modified_gmt":"2016-08-20T01:35:48","slug":"wordpress-behind-reverse-proxy-1","status":"closed","type":"topic","link":"https:\/\/wordpress.org\/support\/topic\/wordpress-behind-reverse-proxy-1\/","title":{"rendered":"WordPress behind reverse proxy"},"content":{"rendered":"<p>Hello,<\/p>\n<p>First of all I&#8217;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&#8217;m unable to resolve it for myself.<\/p>\n<p>The setup:<\/p>\n<p>wordpress is installed on firewalled internal server http:\/\/some.domain.com:12345\/wordpress<\/p>\n<p>public proxy server is on http:\/\/some.example.com\/home<\/p>\n<p>The redirect happens as expected, however, all the images (theme layout) and css doesn&#8217;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.<\/p>\n<p>To solve this I have tried setting site\/wordpress url from admin site to various values&#8230;with no success, since after the change I could no longer login to the admin side even internally &#8212; so I reverted this change.<\/p>\n<p>I have tried editing _SERVER[&#8216;HTTP_HOST&#8217;] variable in wp-config: at best I get &#8220;http:\/\/some.example.com:12345\/wordpress&#8221; when I try to access wordpress from the public proxy, which obviously doesn&#8217;t work. At least the internal url still works.<\/p>\n<p>I&#8217;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&#8217;ve also read about. I&#8217;ve set ProxyPreserveHost on, which doesn&#8217;t seem to have had a positive effect. <\/p>\n<p>I&#8217;ve RTFM about the _SERVER variable, and tried to play with other pieces of it with no success.<\/p>\n<p>My problem might be that I&#8217;m using piecemeal knowledge to solve this issue and turning &#8220;switches&#8221; on and off blindly. A lot of the forum posts address a specific part, but there is nowhere that I&#8217;ve found that provides a global solution. (Let me know if you need more detail about any of the specific solutions I&#8217;ve tried.)<\/p>\n<p>Any help is appreciated.<\/p>\n","protected":false},"template":"","class_list":["post-2200386","topic","type-topic","status-closed","hentry","topic-tag-http_host","topic-tag-redirect","topic-tag-reverse-proxy"],"jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic\/2200386","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic"}],"about":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/types\/topic"}],"version-history":[{"count":0,"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic\/2200386\/revisions"}],"wp:attachment":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/media?parent=2200386"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}