You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by Sébastien Moretti <se...@unil.ch> on 2010/11/17 14:04:53 UTC

[users@httpd] RewriteRule & jsessionid

Hi

I experience some problem with apache, mod_rewrite and mod_proxy.
I get some timeouts that deny access to the server.
Here is the error message I get:

(70007)The timeout specified has expired: proxy: error reading status 
line from remote server XXX
[Wed Nov 17 11:57:09 2010] [error] [client 130.223.50.57] proxy: Error 
reading from remote server returned by 
/YYY/yyy;jsessionid=CB0770CE21131F029565895AC72B921E


It happens when I set this particular rule:
RewriteRule ^/YYY/yyy(.+)  /YYY/yyy$1  [P]


In fact, I want to mask YYY/yyy in URLs, and create an internal, silent, 
redirection.
e.g.: http://abc.ch/?smth
would be in fact
       http://XXX/YYY/yyy?smth

Maybe I do something wrong. The rule could certainly be more properly 
written.
But on our development server, I don't get the problem (but apache 
versions and configurations are a bit different).


Any idea ?

-- 
Sébastien Moretti

---------------------------------------------------------------------
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] RewriteRule & jsessionid

Posted by Sébastien Moretti <se...@unil.ch>.
>     Hi
>
>     I experience some problem with apache, mod_rewrite and mod_proxy.
>     I get some timeouts that deny access to the server.
>     Here is the error message I get:
>
>     (70007)The timeout specified has expired: proxy: error reading
>     status line from remote server XXX
>     [Wed Nov 17 11:57:09 2010] [error] [client 130.223.50.57] proxy:
>     Error reading from remote server returned by
>     /YYY/yyy;jsessionid=CB0770CE21131F029565895AC72B921E
>
>
>     It happens when I set this particular rule:
>     RewriteRule ^/YYY/yyy(.+)  /YYY/yyy$1  [P]
>
> To me, this rule doesn't make sense. You are rewriting it to be the same
> thing as before.

This rule looks weird in my opinion also; but works properly on our 
development server.

It must be: get the whole URL, but YYY/yyy, and do the mapping.
Something like
     RewriteRule ^/([^YYY/yyy].+)  /YYY/yyy$1  [P]


The redirection is on the same server, within the same virtual host.
http://XXX/?smth   would be    http://XXX/YYY/yyy?smth
(XXX is abc.ch)

And both URLs must work.

>     In fact, I want to mask YYY/yyy in URLs, and create an internal,
>     silent, redirection.
>     e.g.: http://abc.ch/?smth
>     would be in fact
>     http://XXX/YYY/yyy?smth
>
> you are reverse proxying from a different host then that host should get
> mentioned in the rule.
>
> E.g
> NameVirtualHost *:80
>
> <VirtualHost *:80?
> ServerName abc.ch <http://abc.ch>
>
> RewriteEngine on
> RewriteRule / http://XXX/YYY/yyy/ [P,QSA]
>
> </VirtualHost>
>
> QSA would add the query string from the original URL to the rewritten URL.
>
>     Maybe I do something wrong. The rule could certainly be more
>     properly written.
>     But on our development server, I don't get the problem (but apache
>     versions and configurations are a bit different).
>
>
>     Any idea ?

-- 
Sébastien Moretti

---------------------------------------------------------------------
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] RewriteRule & jsessionid

Posted by Sai A <ar...@gmail.com>.
On Wed, Nov 17, 2010 at 6:34 PM, Sébastien Moretti <
sebastien.moretti@unil.ch> wrote:

> Hi
>
> I experience some problem with apache, mod_rewrite and mod_proxy.
> I get some timeouts that deny access to the server.
> Here is the error message I get:
>
> (70007)The timeout specified has expired: proxy: error reading status line
> from remote server XXX
> [Wed Nov 17 11:57:09 2010] [error] [client 130.223.50.57] proxy: Error
> reading from remote server returned by
> /YYY/yyy;jsessionid=CB0770CE21131F029565895AC72B921E
>
>
> It happens when I set this particular rule:
> RewriteRule ^/YYY/yyy(.+)  /YYY/yyy$1  [P]
>
> To me, this rule doesn't make sense. You are rewriting it to be the same
thing as before.


>
> In fact, I want to mask YYY/yyy in URLs, and create an internal, silent,
> redirection.
> e.g.: http://abc.ch/?smth
> would be in fact
>      http://XXX/YYY/yyy?smth
>
> you are reverse proxying from a different host then that host should get
mentioned in the rule.

E.g
NameVirtualHost *:80

<VirtualHost *:80?
ServerName abc.ch

RewriteEngine on
RewriteRule / http://XXX/YYY/yyy/ [P,QSA]

</VirtualHost>

QSA would add the query string from the original URL to the rewritten URL.



> Maybe I do something wrong. The rule could certainly be more properly
> written.
> But on our development server, I don't get the problem (but apache versions
> and configurations are a bit different).
>
>
> Any idea ?
>
> --
> Sébastien Moretti
>
> ---------------------------------------------------------------------
> 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
>
>