Reverse proxy with mod_rewrite using RewriteRule [P]

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

 



Hello:

We have two Apaches in a server:

Apache 2.2.14, reverse proxy, listening to IP 192.168.24.X
Apache 2.2.11, which actually serves the websites, listening to IP 192.168.24.Y

Domain name proxy.mysite.es points to our reverse proxy Apache, and we need it to send requests to the other Apache in this way:

http://proxy.mysite.es/something -> http://something.mysite.es

Our rewrite rule:

RewriteRule ^/(.*) http://$1.mysite.es/ [L,P]

In RewriteLog we can see that the rewrite rule is working fine up to some point:

192.168.24.X - - [02/Mar/2010:15:46:19 +0100] [pre.mysite.es/sid#db73a0][rid#eef078/initial] (2) init rewrite engine with requested uri /something 192.168.24.X - - [02/Mar/2010:15:46:19 +0100] [pre.mysite.es/sid#db73a0][rid#eef078/initial] (3) applying pattern '^/(.*)' to uri '/something' 192.168.24.X - - [02/Mar/2010:15:46:19 +0100] [pre.mysite.es/sid#db73a0][rid#eef078/initial] (2) rewrite '/something' -> 'http://something.mysite.es/' 192.168.24.X - - [02/Mar/2010:15:46:19 +0100] [pre.mysite.es/sid#db73a0][rid#eef078/initial] (2) forcing proxy-throughput with http://something.mysite.es/ 192.168.24.X - - [02/Mar/2010:15:46:19 +0100] [pre.mysite.es/sid#db73a0][rid#eef078/initial] (1) go-ahead with proxy request proxy:http://something.mysite.es/ [OK]

Good, that is what we want, but it seems like something.mysite.es is not being sent to the Apache 2.2.11 but to the reverse proxy Apache itself, because the log follows:

192.168.24.X - - [02/Mar/2010:15:46:19 +0100] [pre.mysite.es/sid#db73a0][rid#ef3088/initial] (2) init rewrite engine with requested uri /public/index.aspx 192.168.24.X - - [02/Mar/2010:15:46:19 +0100] [pre.mysite.es/sid#db73a0][rid#ef3088/initial] (3) applying pattern '^/(.*)' to uri '/public/index.aspx' 192.168.24.X - - [02/Mar/2010:15:46:19 +0100] [pre.mysite.es/sid#db73a0][rid#ef3088/initial] (2) rewrite '/public/index.aspx' -> 'http://public/index.aspx.mysite.es/' 192.168.24.X - - [02/Mar/2010:15:46:19 +0100] [pre.mysite.es/sid#db73a0][rid#ef3088/initial] (2) forcing proxy-throughput with http://public/index.aspx.mysite.es/ 192.168.24.X - - [02/Mar/2010:15:46:19 +0100] [pre.mysite.es/sid#db73a0][rid#ef3088/initial] (1) go-ahead with proxy request proxy:http://public/index.aspx.mysite.es/ [OK]

Which of course leads to failure because of not being able to resolve domain name "public". A ping to something.mysite.es shows that it is being resolved to 192.168.24.Y, which is correct.

Any clue?

Thank you very much.

Daniel


Protección de Datos: ACOTELSA le informa de que los datos facilitados por Ud. y utilizados para el envío de esta comunicación serán objeto de tratamiento automatizado o no en nuestros ficheros, con la finalidad de gestionar la agenda de contactos de nuestra empresa y para el envío de comunicaciones profesionales por cualquier medio electrónico o no. Vd. podrá en cualquier momento ejercer el derecho de acceso, rectificación, cancelación y oposición en los términos establecidos en la Ley Orgánica 15/1999. El responsable del tratamiento es ACOTELSA, con domicilio en Ronda de Poniente, 3 bajo, 28760 Tres Cantos, Madrid.

Confidencialidad El contenido de esta comunicación, así como el de toda la documentación anexa, es confidencial y va dirigido únicamente al destinatario del mismo. En el supuesto de que usted no fuera el destinatario, le solicitamos que nos lo indique y no comunique su contenido a terceros, procediendo a su destrucción. Gracias.

Confidenciality The content of this communication and any attached information is confidential and exclusively for the use of the addressee. If you are not the addressee, we ask you to notify to the sender and do not pass its content to another person, and please be sure you destroy it. Thank you.



---------------------------------------------------------------------
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