Re: [users@httpd] rewritemap help?

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

 



Solved.

Thank you very VERY much for the help Joshua. :)

--
Chris.

----- Original Message ----- From: "Chris Knipe" <savage@xxxxxxxxxxxxx>
To: <users@xxxxxxxxxxxxxxxx>
Sent: Tuesday, August 16, 2005 10:22 AM
Subject: Re: [users@httpd] rewritemap help?


RewriteCond %{HTTP_HOST} ^${MyMap:%{HTTP_HOST}}$
RewriteRule ^(.{MyMap:%{HTTP_HOST}})$ <something here that is the value of
the key>$1 [P]

Basically, anything to host 1, proxy to host 2..... The main reason wanting to use a external map, is so that we can add/remove/modify mappings on the
fly without having to restart apache....

Try something like
RewriteCond ${MyMap:%{HTTP_HOST}|not-found} !=not-found
RewriteRule (.*) http://${MyMap:%{HTTP_HOST}}$1

And be sure to use the RewriteLog to help you debug.

Morning.  Unfortunately, no luck :(

The config as it stands now:
RewriteEngine On
RewriteLog <log file>
RewriteLogLevel 9
RewriteMap MyMap txt:<file>
RewriteConf ${MyMap:%{HTTP_HOST}|not-found} !=not-found
RewriteRule (.*)$ http://${MyMap:%{HTTP_HOST}}$1 [P]

My map, contains:
my.domain.com internal.my.domain.com

Going to my.domain.com, the request ends up on my default v-host, which is configured after the Rewrite section. My RewriteLog, shows nudda... Blank. I've added the [P] as Apache MUST proxy these requests... The internal.my.domain.com is not accessable for any machines on the Internet, only the apache servers doing the rewriting, hence, it must proxy, and not show the browser the internal URLs etc.

Doing the above on a 'per vhost' config works very well (we have that running already), but we now obviously wants to move to a map in order to not having to restart / reconfigure new vhosts all the time in Apache....

--
Chris.








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





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