WordPress.org

Make WordPress Core

Opened 3 years ago

Closed 8 months ago

#18944 closed defect (bug) (invalid)

wrong url in sortable column headers when behind a reverse proxy

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

Description

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
wp-admin/includes/class-wp-list-table.php
but with no luck.

I suppose that pagination may have the same problem.

Attachments (1)

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

Download all attachments as: .zip

Change History (11)

gamboz3 years ago

problematic links

comment:1 gamboz3 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.

comment:2 kurtpayne3 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.

comment:3 gamboz2 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"...

comment:4 CircaLucid2 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'];

comment:5 helenyhou2 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.

comment:6 ocean902 years ago

Duplicates: #20562, #19216

comment:7 tobias21 months 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 http://wordpress.org/support/topic/err_too_many_redirects-nur-unter-wp-adminnetwork for details.

Version 0, edited 21 months ago by tobias (next)

comment:8 DrewAPicture8 months ago

  • Keywords dev-feedback added; reporter-feedback removed

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

comment:9 SergeyBiryukov8 months ago

  • Component changed from General to Administration

Related: #16932, #19337, #22427.

comment:10 nacin8 months 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.