Re: HTTP Apache, RewriteRule [L,P] to localhost

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 01/08/07, bart30 <spmzqsix@xxxxxxxxxxxx> wrote:
> I have trouble with Apache behaviour between two environments with
> equivalent configuration files.
> I have a rewrite rule with [L,P] flags and substitution URL target the local
> apache server.
>
> When the server is requested in consequence to proxy rewrite rule :
>   - In environement 1, there are no more rewriting (proxy request processed
> internally after initial rewriting)
>   - In environement 2, there are 2nd rewriting pass (it is a new HTTP
> request)
[snip]
> Logs  (2 rewriting passes)  on server-two.com  @ IP = 000.00.000.02 :
>
> 000.00.000.01 - - [27/Jul/2007:15:37:28 +0200]
> [server-two.com/sid#b5f20][rid#17a928/initial] (2) init rewrite engine with
> requested uri /
> 000.00.000.01 - - [27/Jul/2007:15:37:28 +0200]
> [server-two.com/sid#b5f20][rid#17a928/initial] (3) applying pattern '^/' to
> uri '/'
> 000.00.000.01 - - [27/Jul/2007:15:37:28 +0200]
> [server-two.com/sid#b5f20][rid#17a928/initial] (4) RewriteCond: input='/'
> pattern='^/$' => matched
> 000.00.000.01 - - [27/Jul/2007:15:37:28 +0200]
> [server-two.com/sid#b5f20][rid#17a928/initial] (2) rewrite / ->
> http://server-two.com:7000/index.jsp
> 000.00.000.01 - - [27/Jul/2007:15:37:28 +0200]
> [server-two.com/sid#b5f20][rid#17a928/initial] (2) forcing proxy-throughput
> with http://server-two.com:7000/index.jsp
> 000.00.000.01 - - [27/Jul/2007:15:37:28 +0200]
> [server-two.com/sid#b5f20][rid#17a928/initial] (1) go-ahead with proxy
> request proxy:http://server-two.com:7000/index.jsp [OK]
> 000.00.000.02 - - [27/Jul/2007:15:37:28 +0200]
> [server-two.com/sid#b5f20][rid#17a928/initial] (2) init rewrite engine with
> requested uri /index.jsp
> 000.00.000.02 - - [27/Jul/2007:15:37:28 +0200]
> [server-two.com/sid#b5f20][rid#17a928/initial] (3) applying pattern '^/' to
> uri '/index.jsp'

Are you sure server2 is running the same proxy modules? For 2.2 it
would need mod_proxy and mod_proxy_http.

Aside from that, I expect you probably don't need mod_rewrite for the
^/$ case. Instead, just put your ProxyPass directives in the correct
order so that the /index.jsp one matches first. IIRC, that would mean:

ProxyPass /index.jsp http://other/...
ProxyPass / http://other/...
ProxyPassReverse ... ...

-- 
noodl

---------------------------------------------------------------------
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@xxxxxxxxxxxxxxxx
   "   from the digest: users-digest-unsubscribe@xxxxxxxxxxxxxxxx
For additional commands, e-mail: users-help@xxxxxxxxxxxxxxxx


[Index of Archives]     [Open SSH Users]     [Linux ACPI]     [Linux Kernel]     [Linux Laptop]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Squid]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]

  Powered by Linux