Re: mod_rewrite help

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

 



On 7/14/07, Jeff Murch <jmurch@xxxxxxx> wrote:




I am running into a problem with a reverse proxy where dynamic links to
detail records are showing up referring to the main webserver on a 10
network instead of the NAT'd public address of the proxy.



An example would be a link showing up from the proxy to the end user's
browser as http://10.2.1.2/cgi-bin/ obviously won't work and needs a rule so
that any occurrence of 10.2.1.2 is replaced with 205.145.160.12 with the
remainder of the URL left unchanged.



From my understanding the most appropriate way to do this would be with
mod_rewrite?

mod_rewrite is not likely the right tool, since it only deals with
meta-data (request and response headers) and not the content of your
pages.

You should start by asking where this internal IP is coming from. Is
it hard-coded in your application someplace? Can you configure your
application to use the public IP? If the application is reading the IP
from the Host: request header, then you could consider using the
ProxyPreserveHost directive to fool it into thinking it has a
different name.

Alternatively, if you really need to rewrite links inside html pages,
the only real solution is mod_proxy_html. Google for it.

Finally, it may be that when you refer to "links", you really mean
"redirects". If this is so, you should make sure you have properly
configured your ProxyPassReverse directive.

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