httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Daniel Gruno <rum...@cord.dk>
Subject Re: [users@httpd] Confusing apache configuration
Date Wed, 27 Jun 2012 13:51:57 GMT
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@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Mime
View raw message