Make WordPress Core

Opened 13 years ago

Closed 12 years ago

Last modified 12 years ago

#17096 closed defect (bug) (invalid)

WP_HTTP_Proxy :: Host check prevents proxying to local

Reported by: jimmynguyc's profile jimmynguyc Owned by:
Milestone: Priority: normal
Severity: normal Version: 3.1
Component: HTTP API Keywords: has-patch 2nd-opinion
Focuses: Cc:


Blog URL check should be optional by defining them in WP_PROXY_BYPASS_HOSTS.

Forcing this check denies me from proxying my blog URL through, which is needed because I'm ProxyPass-ing certain /directories to another server.


<VirtualHost *:80>

ProxyPass /special


/special is on a separate server running another CMS. Its IP is hardcoded in the server's hosts file.


I will have this in my wp-config.php for the WP http requests to work.

define('WP_PROXY_HOST', '');
define('WP_PROXY_PORT', '80');

Attachments (1)

17096.diff (412 bytes) - added by jimmynguyc 13 years ago.

Download all attachments as: .zip

Change History (6)

13 years ago

#1 @dd32
12 years ago

  • Keywords 2nd-opinion added

The check here would be to prevent Cron loopback requests from being made via the proxy.. I don't think we can change/remove that.

#2 @jimmynguyc
12 years ago

Well in my case I needed the cron to loopback because resolving the hostname will point the request to another server, as the host file was hardcoded to a different server for the domain name.

As mentioned I needed to do a proxypass of a certain subfolder to a different server, hence the hardcoded IP in /etc/hosts.

It works fine as long as the request came from outside, but if a request came from the server (e.g. a cron task) it will be pointing to a different IP as per defined in /etc/hosts. Meaning that crons jobs will never be executed.

Hence the hack and the WP_HTTP_PROXY workaround which I found is the only way to fix my problem.

Any thoughts?

#3 @dd32
12 years ago

Ultimately, If the IP address of current site is redirected elsewhere, it's not going to end well..

The "common" way to do that would be have the other server named differently eg:

ProxyPass /special

that way DNS hacking isn't needed.

The Proxy support in core is designed for outgoing requests, rather than loopback requests.

In your case, I'd be filtering outgoing HTTP requests, If it's for the current domain, alter the request to goto and force a Host header.. WordPress Beta Tester plugin intercepts connections and rewrites them, you might be able to do something similar.

#4 @jimmynguyc
12 years ago

  • Resolution set to invalid
  • Status changed from new to closed

Thanks I'll give that a try :)

#5 @SergeyBiryukov
12 years ago

  • Milestone Awaiting Review deleted
Note: See TracTickets for help on using tickets.