httpd-bugs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject [Bug 54359] HTTPS 404 Not Found error references server port 80
Date Wed, 02 Jan 2013 19:16:45 GMT
https://issues.apache.org/bugzilla/show_bug.cgi?id=54359

Martin Bokman <martin@lavv.us> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEEDINFO                    |NEW

--- Comment #2 from Martin Bokman <martin@lavv.us> ---
> Are you reporting this as an issue of httpd.apache.org, specifically?

No, not really. I ran into this while debugging an issue I have with a Rack
application. But I thought to demonstrate it with httpd.apache.org since that
would presumably sidestep a lot of questions about my specific setup.

In my setup a Rack application runs on localhost and listens at port 9002, I am
using Apache on the front end for HTTPS requests which are then forwarded via
HTTP using ProxyPass(Reverse) to that port 9002.

In my case, for almost all of the proxy'ed requests this works like a charm,
except for PUTs which generate a 404 Not Found and list port 80 even though it
are HTTPS requests proxy'ed to 9002. I would therefore expect the port to be
listed either as 443 or 9002, port 80 does not really make sense.

All configuration is in a VirtualHost, something like this:

<VirtualHost host.example.com:443>
ServerName host.example.com
ProxyRequests Off
ProxyPreserveHost On
ProxyPass / http://localhost:9002/
ProxyPassReverse / http://localhost:9002/

SetEnvIf Host "([^:]*):?.*" MY_HTTP_HOST=$1
RequestHeader set Host "%{MY_HTTP_HOST}e"

SetEnvIf X-Forwarded-Proto ".*" MY_HTTP_PROTO=https
RequestHeader set X-Forwarded-Proto "%{MY_HTTP_PROTO}e"

SetEnvIf X-Forwarded-Port ".*" MY_HTTP_PORT=443
RequestHeader set X-Forwarded-Port "%{MY_HTTP_PORT}e"

#RequestHeader set X-Forwarded-Proto https
#RequestHeader set X-Forwarded-Port 443
#RequestHeader set Host host.example.com

CustomLog logs/ssl_request_log \
          "%v %t %h %{SSL_PROTOCOL}x %{SSL_CIPHER}x \"%r\" %b\nLocal
IP-address:
 %A\nEnv. MY_HTTP_HOST: %{MY_HTTP_HOST}e\nHost: %{Host}i\nEnv. MY_HTTP_PROTO:
%{
MY_HTTP_PROTO}e\nX-Forwarded-Proto: %{X-Forwarded-Proto}i\nEnv. MY_HTTP_PORT:
%{
MY_HTTP_PORT}e\nX-Forwarded-Port: %{X-Forwarded-Port}i\nRequest method:
%m\nQuer
y string: %q\nFirst line of request: %r\nStatus: %s\nStatus (final): %>s"

</VirtualHost>

The Rack application requires the Host, X-Forwarded-Proto and X-Forwarded-Port
headers to be set correctly, hence the above SetEnvIf trickery. The commented
out RequestHeader directives were not working correctly in all cases. Using the
CustomLog directive as listed I can verify that all those headers are indeed
set correctly, also in the case of the PUTs which result in the 404 Not Found.

I have put the status of this issue back in NEW, I hope that is okay after
providing the above information.

-- 
You are receiving this mail because:
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@httpd.apache.org
For additional commands, e-mail: bugs-help@httpd.apache.org


Mime
View raw message