Re: Confusing apache configuration

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

 



On 06/27/2012 03:29 PM, Robert Decker wrote:
> Hello. I'm having trouble figuring out how to configure apache for the
> following:
> 
> www.server.com/mstar should go through mod_passenger
> 
> but anything else, such as:
> www.server.com/
> www.server.com/index.hmtl
> etc
> should go through mod_proxy.
> 
> So, I would need something to check if it has /mstar as the first
> component of the path and if so, have it served through passenger. But
> anything else should go through mod_proxy.
> 
> something like:
> 
> <VirtualHost *:80>
>         ServerName beta.server.com
> 
>         DocumentRoot /home/ruby/webapps/m-star/current/public
> 
>         <Location /mstar>
>             PassengerEnabled on
>             RailsBaseURI /mstar
>             # This relaxes Apache security settings.
>             AllowOverride all
>             # MultiViews must be turned off.
>             Options -MultiViews FollowSymLinks
>             Order allow,deny
>             Allow from all
>         </Location>
> 
>         ProxyPass / http://beta.server.com:8890
>         ProxyPassReverse / http://beta.server.com:8890
>         <Location />
>             PassengerEnabled off
>             Order allow,deny
>             Allow from all
>         </Location>
> </VirtualHost>
> 
> However, this of course is not working.
> 
> Can you give me some pointers on what to look at in the apache
> configurations to accomplish this?
> 
What you might find useful is to use ProxyPassMatch with a negative
lookahead. Try replacing your ProxyPass directive with:

ProxyPassMatch ^/(?!mstar)(.*) http://beta.server.com:8890/$1

This will effectively proxy only URIs that do not start with /mstar.

With regards,
Daniel.

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