I want to restrict a staging server with basic auth, except for one special location, which should not have basic auth but be restricted to a client IP block.

My virtual host section looks like this:

DocumentRoot /var/www/vhosts/example/public
ServerName beta.example.com

<Directory /var/www/vhosts/example/public>
    Options FollowSymLinks -MultiViews
    AllowOverride all
    Order allow,deny
    Allow from all
</Directory>

<Location />
    AuthUserFile /var/www/.htpasswd
    AuthType Basic
    AuthName "Secret"
    Require valid-user
</Location>

<Location /payment/ipn>
    # How can I disable basic auth here?

    Order deny,allow
    Deny from all
    Allow from 216.113.191
</Location>

So, nobody should be able to access the site, unless they know the password. But the PayPal Sandbox (216.113.191.xxx) should be able to access http://beta.example.com/payment/ipn to send instant payment notifications.

I'm hosting Rails 3 via Passenger on Apache2.

link|improve this question
feedback

1 Answer

up vote 2 down vote accepted

Sounds like you want Satisfy.

Satisfy Any
link|improve this answer
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.