Re: Problem with wildcard subdomains and ProxyPass

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

 



On Tue, Apr 2, 2013 at 5:18 PM, Thibaut Lemaire <tib1avivo@xxxxxxxxx> wrote:
> Hi,
>
> I want to use Apache to proxy requests like domain.tld.MyDomain.tld to
> domain.tld.
>
> I've tried this :
>
> <VirtualHost *:80>
>      RewriteEngine on
>      RewriteCond     %{HTTP_HOST}    (.*).MyDomain.tld$
>      RewriteRule     (.*).MyDomain.tld$  $1
>      ProxyPassMatch /http://$1/
> </VirtualHost>
>

If you have a matching group in a RewriteCond, the match is available
in %N, not $N.

Capture in RewriteCond => %N
Capture in RewriteRule => $N

However, you can't use rewrite and mod_proxy like that. What you can
do is to use RewriteRule/Cond to generate a URL, and ask apache to
proxy to that URL by giving the RewriteRule a [P] flag (ie, no
ProxyPassMatch).

I'm still not sure what you are trying to do though.
Do you mean proxy - you want to connect to a different server, fetch
that content over the network to this server, and then deliver it to
the client?
Or do you want an internal rewrite - ask apache to internally request
this content from a different vhost hosted by this apache server?

Cheers

Tom

---------------------------------------------------------------------
To unsubscribe, e-mail: users-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