server {
satisfy any;
auth_basic “DING DING SONG”;
auth_basic_user_file /etc/apache2/htpasswd;
allow from CIDR;
allow from CIDR;
allow from CIDR;
allow from CIDR;
location ^~ /allowed/ {
allow all;
}
deny all;
}
I short, I want to disallow access on my website, only some IPs can
access, except for /allowed/ which is open.
Document sans nom> True, but I can’t do that as “location / {}” is in a
common config included by many other vhosts.
Then to clarify - you want to deny the access to all the “other vhosts”
or
just one?
If one - per Server names you can
leave
the current config for all the “other vhosts” but define the one
specific
host you want to deny the access with exact server_name or if you use
regular expression in the server_name place it as first in the main
config.
If its all vhosts then just modify the included common config.
But in general it is hard to give you configuration suggestions not
knowing
how is your existing setup.
Typically vhosts (at least for me) each have their own server {} block
so
each one can have its own location definitions but the common parts
(like
*.php) can be included.
rr
This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.