You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by Lewis Hoffman <le...@grasscommons.org> on 2006/06/28 00:28:22 UTC
[users@httpd] reverse proxy fails on uri escape sequences
Hello,
I'm running a reverse proxy in apache-2.0.54
For most urls, it's working great. However, some URI escape sequences cause
404s from apache. It seems as if they never get to the rewrite rule.
For example, these two URLs:
1) http://wagon.grasscommons.org/c/wiki/new/thisthat
2) http://wagon.grasscommons.org/c/wiki/new/this%2Fthat
access log entries for the two requests, respectively:
67.42.179.239 - - [27/Jun/2006:15:13:49 -0700] "GET /c/wiki/new/thisthat
HTTP/1.1" 200 2404 "-" "Mozilla/5.0 (X11; U; Linux i686 (x86_64); en-US; rv:
1.8.0.3) Gecko/20060326 Firefox/1.5.0.3 (Debian-1.5.dfsg+1.5.0.3-2)"
67.42.179.239 - - [27/Jun/2006:15:13:20 -0700] "GET /c/wiki/new/this%2Fthat
HTTP/1.1" 404 218 "-" "Mozilla/5.0 (X11; U; Linux i686 (x86_64); en-US; rv:
1.8.0.3) Gecko/20060326 Firefox/1.5.0.3 (Debian-1.5.dfsg+1.5.0.3-2)"
rewriteLog entries for the first url:
67.42.179.239 - - [27/Jun/2006:15:12:05 --0700] [
wagon.grasscommons.org/sid#6205b8][rid#672bf0/initial] (2) init rewrite
engine with requested uri /c/wiki/new/thisthat
67.42.179.239 - - [27/Jun/2006:15:12:05 --0700] [
wagon.grasscommons.org/sid#6205b8][rid#672bf0/initial] (3) applying pattern
'^/(.*)' to uri '/c/wiki/new/thisthat'
67.42.179.239 - - [27/Jun/2006:15:12:05 --0700] [
wagon.grasscommons.org/sid#6205b8][rid#672bf0/initial] (2) rewrite
/c/wiki/new/thisthat -> http://localhost:3051/c/wiki/new/thisthat
67.42.179.239 - - [27/Jun/2006:15:12:05 --0700] [
wagon.grasscommons.org/sid#6205b8][rid#672bf0/initial] (2) forcing
proxy-throughput with http://localhost:3051/c/wiki/new/thisthat
67.42.179.239 - - [27/Jun/2006:15:12:05 --0700] [
wagon.grasscommons.org/sid#6205b8][rid#672bf0/initial] (1) go-ahead with
proxy request proxy:http://localhost:3051/c/wiki/new/thisthat [OK]
rewrite log entries for the second url: none
My virtual host config looks like this:
NameVirtualHost *
<VirtualHost *>
ServerName wagon.grasscommons.org
ServerAlias wagn.grasscommons.org
RewriteEngine On
ProxyRequests Off
RewriteRule ^/(.*) http://localhost:3051/$1 [P,L]
ProxyPassReverse / http://localhost:3051/
RewriteLog "/var/log/apache2-161/wagon-rewrite.log"
RewriteLogLevel 4
<Proxy *>
Order Allow,Deny
Allow from all
</Proxy>
</VirtualHost>
Any ideas?
--
Lewis Hoffman
Grass Commons
lewis at grasscommons dot org
Re: [users@httpd] reverse proxy fails on uri escape sequences
Posted by Lewis Hoffman <le...@grasscommons.org>.
ahh, thank you thank you thank you :-)
On 6/28/06, Joshua Slive <jo...@slive.ca> wrote:
>
> On 6/27/06, Lewis Hoffman <le...@grasscommons.org> wrote:
> > Hello,
> >
> > I'm running a reverse proxy in apache-2.0.54
> > For most urls, it's working great. However, some URI escape sequences
> cause
> > 404s from apache. It seems as if they never get to the rewrite rule.
> >
> > For example, these two URLs:
> > 1) http://wagon.grasscommons.org/c/wiki/new/thisthat
> > 2) http://wagon.grasscommons.org/c/wiki/new/this%2Fthat
> >
> > access log entries for the two requests, respectively:
> >
> > 67.42.179.239 - - [27/Jun/2006:15:13:49 -0700] "GET /c/wiki/new/thisthat
> > HTTP/1.1" 200 2404 "-" "Mozilla/5.0 (X11; U; Linux i686 (x86_64); en-US;
> > rv:1.8.0.3) Gecko/20060326 Firefox/1.5.0.3 (Debian-1.5.dfsg+1.5.0.3-2)"
> > 67.42.179.239 - - [27/Jun/2006:15:13:20 -0700] "GET
> /c/wiki/new/this%2Fthat
> > HTTP/1.1" 404 218 "-" "Mozilla/5.0 (X11; U; Linux i686 (x86_64); en-US;
> > rv:1.8.0.3) Gecko/20060326 Firefox/1.5.0.3 (Debian-1.5.dfsg+1.5.0.3-2)"
>
> Try this:
> http://httpd.apache.org/docs/2.0/mod/core.html#allowencodedslashes
>
> Encoded slashes are not allowed by default because they can be used to
> trick some scripts into disclosing protected content. (Although that
> seems like a pretty weak explanation to me. Lot's of other characters
> cause potential problems.)
>
> Joshua.
>
> Joshua.
>
> ---------------------------------------------------------------------
> The official User-To-User support forum of the Apache HTTP Server Project.
> See <URL:http://httpd.apache.org/userslist.html> for more info.
> To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
> " from the digest: users-digest-unsubscribe@httpd.apache.org
> For additional commands, e-mail: users-help@httpd.apache.org
>
>
--
Lewis Hoffman
Grass Commons
lewis@grasscommons.org
541-343-1944
Re: [users@httpd] reverse proxy fails on uri escape sequences
Posted by Joshua Slive <jo...@slive.ca>.
On 6/27/06, Lewis Hoffman <le...@grasscommons.org> wrote:
> Hello,
>
> I'm running a reverse proxy in apache-2.0.54
> For most urls, it's working great. However, some URI escape sequences cause
> 404s from apache. It seems as if they never get to the rewrite rule.
>
> For example, these two URLs:
> 1) http://wagon.grasscommons.org/c/wiki/new/thisthat
> 2) http://wagon.grasscommons.org/c/wiki/new/this%2Fthat
>
> access log entries for the two requests, respectively:
>
> 67.42.179.239 - - [27/Jun/2006:15:13:49 -0700] "GET /c/wiki/new/thisthat
> HTTP/1.1" 200 2404 "-" "Mozilla/5.0 (X11; U; Linux i686 (x86_64); en-US;
> rv:1.8.0.3) Gecko/20060326 Firefox/1.5.0.3 (Debian-1.5.dfsg+1.5.0.3-2)"
> 67.42.179.239 - - [27/Jun/2006:15:13:20 -0700] "GET /c/wiki/new/this%2Fthat
> HTTP/1.1" 404 218 "-" "Mozilla/5.0 (X11; U; Linux i686 (x86_64); en-US;
> rv:1.8.0.3) Gecko/20060326 Firefox/1.5.0.3 (Debian-1.5.dfsg+1.5.0.3-2)"
Try this:
http://httpd.apache.org/docs/2.0/mod/core.html#allowencodedslashes
Encoded slashes are not allowed by default because they can be used to
trick some scripts into disclosing protected content. (Although that
seems like a pretty weak explanation to me. Lot's of other characters
cause potential problems.)
Joshua.
Joshua.
---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
" from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org
Re: [users@httpd] reverse proxy fails on uri escape sequences
Posted by fr...@netscape.net.
Hi,
I am also setting up a reverse proxy server. Do you know how to add a charset for libxml2?
It is required for mod_proxy_html
Frank Peng.
-----Original Message-----
From: Lewis Hoffman <le...@grasscommons.org>
To: users@httpd.apache.org
Sent: Tue, 27 Jun 2006 22:28:22 +0000
Subject: [users@httpd] reverse proxy fails on uri escape sequences
Hello,
I'm running a reverse proxy in apache-2.0.54
For most urls, it's working great. However, some URI escape sequences cause 404s from apache. It seems as if they never get to the rewrite rule.
For example, these two URLs:
1) http://wagon.grasscommons.org/c/wiki/new/thisthat
2) http://wagon.grasscommons.org/c/wiki/new/this%2Fthat
access log entries for the two requests, respectively:
67.42.179.239 - - [27/Jun/2006:15:13:49 -0700] "GET /c/wiki/new/thisthat HTTP/1.1" 200 2404 "-" "Mozilla/5.0 (X11; U; Linux i686 (x86_64); en-US; rv:1.8.0.3) Gecko/20060326 Firefox/1.5.0.3 (Debian-1.5.dfsg+1.5.0.3-2)"
67.42.179.239 - - [27/Jun/2006:15:13:20 -0700] "GET /c/wiki/new/this%2Fthat HTTP/1.1" 404 218 "-" "Mozilla/5.0 (X11; U; Linux i686 (x86_64); en-US; rv:1.8.0.3) Gecko/20060326 Firefox/1.5.0.3 (Debian-1.5.dfsg+1.5.0.3-2)"
rewriteLog entries for the first url:
67.42.179.239 - - [27/Jun/2006:15:12:05 --0700] [wagon.grasscommons.org/sid#6205b8][rid#672bf0/initial ] (2) init rewrite engine with requested uri /c/wiki/new/thisthat
67.42.179.239 - - [27/Jun/2006:15:12:05 --0700] [ wagon.grasscommons.org/sid#6205b8][rid#672bf0/initial] (3) applying pattern '^/(.*)' to uri '/c/wiki/new/thisthat'
67.42.179.239 - - [27/Jun/2006:15:12:05 --0700] [ wagon.grasscommons.org/sid#6205b8][rid#672bf0/initial] (2) rewrite /c/wiki/new/thisthat -> http://localhost:3051/c/wiki/new/thisthat
67.42.179.239 - - [27/Jun/2006:15:12:05 --0700] [wagon.grasscommons.org/sid#6205b8][rid#672bf0/initial] (2) forcing proxy-throughput with http://localhost:3051/c/wiki/new/thisthat
67.42.179.239 - - [27/Jun/2006:15:12:05 --0700] [wagon.grasscommons.org/sid#6205b8][rid#672bf0/initial ] (1) go-ahead with proxy request proxy:http://localhost:3051/c/wiki/new/thisthat [OK]
rewrite log entries for the second url: none
My virtual host config looks like this:
NameVirtualHost *
<VirtualHost *>
ServerName wagon.grasscommons.org
ServerAlias wagn.grasscommons.org
RewriteEngine On
ProxyRequests Off
RewriteRule ^/(.*) http://localhost:3051/$1 [P,L]
ProxyPassReverse / http://localhost:3051/
RewriteLog "/var/log/apache2-161/wagon- rewrite.log"
RewriteLogLevel 4
<Proxy *>
Order Allow,Deny
Allow from all
</Proxy>
</VirtualHost>
Any ideas?
--
Lewis Hoffman
Grass Commons
lewis at grasscommons dot org