Make WordPress Core

Opened 13 years ago

Closed 11 years ago

#18944 closed defect (bug) (invalid)

wrong url in sortable column headers when behind a reverse proxy

Reported by: gamboz's profile gamboz Owned by:
Milestone: Priority: normal
Severity: normal Version: 3.2.1
Component: Administration Keywords: dev-feedback
Focuses: Cc:


Hi, I have a wordpress site behind a reverse proxy. All works fine but for the urls used in the headers of sortable columns.

For instance, the links of "Title", "Author", etc. of the table of posts in wp-admin/edit.php --> Posts report something like "http://backend/backend-dir/..." while they should be "http://frontend/frontend-dir/...".

I don't think this is a proxy configuration problem because, AFAICS, the rest of the site is working: I can make posts, pages, media, install themes and plugins.

I tried to play with $current_url al line 649 of
but with no luck.

I suppose that pagination may have the same problem.

Attachments (1)

screenshot1.png (54.9 KB) - added by gamboz 13 years ago.
problematic links

Download all attachments as: .zip

Change History (11)

13 years ago

problematic links

#1 @gamboz
13 years ago

Other things that fail:

. redirect from "bulk actions": here _wp_http_referrer is "/bakend-dir/..." but should be "/frontend-dir/...". Only the redirect fails, the action is done.

. delete plugins: the form action is "/bakend-dir/..." but should be "/frontend-dir/..."

The screen options (top right-hand-side of the dashboard) also have the _wp_http_referrer wrong, but I did not experience any problem there.

#2 @kurtpayne
13 years ago

  • Cc kpayne@… added
  • Keywords reporter-feedback added

Check the logic in the wp_fix_server_vars() function on your site.

I have a reverse proxy setup here (apache mod_proxy), but cannot reproduce this.

#3 @gamboz
13 years ago

I'm also using apache mod_proxy.

I think I can get rid of the problem if
. ProxyPreserveHost On
. backend-dir == frotend-dir (and change "WordPress address" and "Site address" accordingly)

Could you confirm this? I.e. do you get my same problem with
. ProxyPreserveHost Off
. backend-dir != frotend-dir

If this is so, I don't know if this can still be considered a bug or, maybe a kind of "wanted feature"...

#4 @CircaLucid
12 years ago

  • Version changed from 3.2.1 to 3.3.1

I have the same issue. I have my apache server behind an nginx proxy.

* The rest of the site uses the correct URL via site_url(), so there's no reason this function should deviate. *

Here's a fix as of 3.3.1 that I've tested on the plugins page:

*** class-wp-list-table.php	2012-03-22 07:53:09.898792699 -0400
--- class-wp-list-table.php.bak	2012-03-22 07:46:39.742794005 -0400
*************** class WP_List_Table {
*** 492 ****
! 		$current_url = site_url() . $_SERVER['REQUEST_URI'];
--- 492 ----
! 		$current_url = ( is_ssl() ? 'https://' : 'http://' ) . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'];
*************** class WP_List_Table {
*** 651 ****
! 		$current_url = site_url() . $_SERVER['REQUEST_URI'];
--- 651 ----
! 		$current_url = ( is_ssl() ? 'https://' : 'http://' ) . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'];

#5 @helenyhou
12 years ago

  • Version changed from 3.3.1 to 3.2.1

The version field is used to track when the bug was first reported or reproduced.

#6 @ocean90
12 years ago

Duplicates: #20562, #19216

#7 @tobias
12 years ago

  • Cc t@… added

Note: We had a problem with this as well with our multisite-installation that runs behind a apache rewrite rule. We ended up overwriting the $_SERVERHTTP_HOST? to work around it. See for details.

Version 0, edited 12 years ago by tobias (next)

#8 @DrewAPicture
11 years ago

  • Keywords dev-feedback added; reporter-feedback removed

Anybody know if this a continuing problem? @dd32 maybe?

#9 @SergeyBiryukov
11 years ago

  • Component changed from General to Administration

Related: #16932, #19337, #22427.

#10 @nacin
11 years ago

  • Milestone Awaiting Review deleted
  • Resolution set to invalid
  • Status changed from new to closed

See #19337.

Any proxy configuration is "supported" by WordPress, you just need to remap the server vars based on whatever that particular proxy configuration is using.

This is proxy 101.

Note: See TracTickets for help on using tickets.