You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by Thomas Eckert <th...@gmail.com> on 2013/09/26 11:58:01 UTC

[users@httpd] Question regarding ProxyPass and "!"

Using a config like this

<Proxy balancer://cd107d9706d71153bafd4ab15f1c6b5d>
        BalancerMember http://backend.example.local status=-SE
</Proxy>
<VirtualHost 10.10.10.10:80>
        ServerName frontend.example.local
        SSLProxyEngine On
        RequestHeader set X-Forwarded-Proto http
        <Location /helloworld/>
                ProxyPass !
                ProxyPassReverse !
        </Location>
        <Location />
                ProxyPass balancer://cd107d9706d71153bafd4ab15f1c6b5d
                ProxyPassReverse balancer://cd107d9706d71153bafd4ab15f1c6b5d
        </Location>
</VirtualHost>

should I not expect requests to /helloworld/ to be mapped to the files
being served directly from frontend.example.local instead of being proxied
away to backend.example.local ? In other words, backend.example.local
should not even see that request.

Re: [users@httpd] Question regarding ProxyPass and "!"

Posted by Jeremy Frank <je...@juggler.org>.
We are doing something more like this on our 2.4 servers:

<Proxy balancer://cd107d9706d71153bafd4ab15f1c6b5d>
    BalancerMember http://backend.example.local status=-SE
</Proxy>
<VirtualHost 10.10.10.10:80>
    ServerName frontend.example.local
    SSLProxyEngine On
    RequestHeader set X-Forwarded-Proto http

    ProxyPass        /helloworld/ !
    ProxyPass        / balancer://cd107d9706d71153bafd4ab15f1c6b5d
    ProxyPassReverse / balancer://cd107d9706d71153bafd4ab15f1c6b5d
</VirtualHost>

-- 
Jeremy

On Thu, September 26, 2013 4:58 am, Thomas Eckert wrote:
> Using a config like this
>
> <Proxy balancer://cd107d9706d71153bafd4ab15f1c6b5d>
>         BalancerMember http://backend.example.local status=-SE
> </Proxy>
> <VirtualHost 10.10.10.10:80>
>         ServerName frontend.example.local
>         SSLProxyEngine On
>         RequestHeader set X-Forwarded-Proto http
>         <Location /helloworld/>
>                 ProxyPass !
>                 ProxyPassReverse !
>         </Location>
>         <Location />
>                 ProxyPass balancer://cd107d9706d71153bafd4ab15f1c6b5d
>                 ProxyPassReverse
> balancer://cd107d9706d71153bafd4ab15f1c6b5d
>         </Location>
> </VirtualHost>
>
> should I not expect requests to /helloworld/ to be mapped to the files
> being served directly from frontend.example.local instead of being proxied
> away to backend.example.local ? In other words, backend.example.local
> should not even see that request.
>



---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] Question regarding ProxyPass and "!"

Posted by Tom Evans <te...@googlemail.com>.
On Thu, Sep 26, 2013 at 10:58 AM, Thomas Eckert
<th...@gmail.com> wrote:
> Using a config like this
>
> <Proxy balancer://cd107d9706d71153bafd4ab15f1c6b5d>
>         BalancerMember http://backend.example.local status=-SE
> </Proxy>
> <VirtualHost 10.10.10.10:80>
>         ServerName frontend.example.local
>         SSLProxyEngine On
>         RequestHeader set X-Forwarded-Proto http
>         <Location /helloworld/>
>                 ProxyPass !
>                 ProxyPassReverse !
>         </Location>
>         <Location />
>                 ProxyPass balancer://cd107d9706d71153bafd4ab15f1c6b5d
>                 ProxyPassReverse balancer://cd107d9706d71153bafd4ab15f1c6b5d
>         </Location>
> </VirtualHost>
>
> should I not expect requests to /helloworld/ to be mapped to the files being
> served directly from frontend.example.local instead of being proxied away to
> backend.example.local ? In other words, backend.example.local should not
> even see that request.


The second Location directive overwrites the first one. Reverse the
order, with the most specific section coming last.

For ProxyPass and Alias, the exact opposite applies, list the most
specific section first.

This is documented here:

http://httpd.apache.org/docs/current/sections.html#overlapping-webspace

Cheers

Tom

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org