[wp-trac] [WordPress Trac] #16932: Media Upload top navigation producing wrong URLs when WordPress is run behind a ReverseProxy

WordPress Trac wp-trac at lists.automattic.com
Thu Mar 24 10:37:40 UTC 2011


#16932: Media Upload top navigation producing wrong URLs when WordPress is run
behind a ReverseProxy
----------------------------+----------------------
 Reporter:  tploch          |       Owner:
     Type:  defect (bug)    |      Status:  closed
 Priority:  normal          |   Milestone:
Component:  Administration  |     Version:  3.1
 Severity:  normal          |  Resolution:  invalid
 Keywords:                  |
----------------------------+----------------------

Comment (by tploch):

 Well, I changed the routing now by basically passing the whole URI
 containing the {{{/blog}}} part to the proxy rewrite, and on the target
 server have another rewrite rewriting it from {{{/blog/foo/bar.php}}} to
 {{{/foo/bar.php}}}

 '''REQUEST_URI''' now reads {{{/blog/wp-admin/media-
 upload.php?post_id=1116}}}, but stuff still breaks.

 i.E. When being on the media dashboard, the pagination uses the wrong
 domain {{{http://example.com/blog/wp-admin/upload.php?paged=1}}} while it
 should be {{{http://otherdomain.com/blog/wp-admin/upload.php?paged=1}}},
 so fixing REQUEST_URI did not fix the general problem, which is
 inconsistent usage of hosts throughout the app.

 This time the {{{HTTP_X_FORWARDED_HOST}}} header, if this is existent, it
 should take precedence over the configured home url.

 For me is another problem, there is no way that HTTP_X_FORWARDED headers
 tell you the protocol of the original request, and in my case i Proxy
 through SSL, so just inspecting this header is not enough.

 Probably this setup is beyond the scope of what WordPress should be able
 to do, but if the HTTP_X_FORWARDED_HOST header was sent, you could inspect
 the referer protocol (which will be set to the proxy domain).

-- 
Ticket URL: <http://core.trac.wordpress.org/ticket/16932#comment:14>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list