Bug 47379 - Reverse proxy configuration does handle HTTP CONNECT requests correctly
Summary: Reverse proxy configuration does handle HTTP CONNECT requests correctly
Status: RESOLVED INVALID
Alias: None
Product: Apache httpd-2
Classification: Unclassified
Component: mod_proxy (show other bugs)
Version: 2.2.9
Hardware: PC All
: P2 normal (vote)
Target Milestone: ---
Assignee: Apache HTTPD Bugs Mailing List
URL:
Keywords: RFC
Depends on:
Blocks:
 
Reported: 2009-06-17 03:04 UTC by Holger Weissboeck
Modified: 2009-06-17 06:10 UTC (History)
0 users



Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Holger Weissboeck 2009-06-17 03:04:57 UTC
Setting up a reverse proxy with:

LoadModule proxy_module modules/mod_proxy.so
LoadModule proxy_http_module modules/mod_proxy_http.so
LoadModule proxy_connect_module modules/mod_proxy_connect.so

Listen 9006
NameVirtualHost *:9006
<VirtualHost *:9006>
 AllowCONNECT 3030
 ProxyPass / xxx.xxx.xxx.xxx:3030
 ProxyPassReverse / xxx.xxx.xxx.xxx:3030
</VirtualHost>

does not work, since the ProxyPass directive throws the error: "ProxyPass URL must be absolute!"

Changing the URL to 

 ProxyPass / http://xxx.xxx.xxx.xxx:3030

makes Apache start, but HTTP CONNECT requests are forwarded to the next endpoint.

Unless i have not misinterpreted the HTTP 1.1 spec, it should not forward a HTTP request to the endpoint when a CONNECT request was received. It should rather create a tunnel and return CONNECTION ESTABLISHED to the initial caller so that the caller and the endpoint can talk a custom protocol tunneled through the reverse proxy.

This worked fine with Apache 2.0.x and works fine with a simple forward proxy. Unfortunately it is broken for reverse proxies.
Comment 1 Ruediger Pluem 2009-06-17 06:10:14 UTC
In fact CONNECT is only for forward proxyies. If it worked in 2.0.x this was unintended and in fact a bug.
But to be honest I don't understand your problem: The CONNECT method requires to specify a target IP and port. So you could just use this.
Anyway Bugzilla is for reporting bugs and no user support forum. So please post your question on the users mailing list.