Hello, i want to show a custom 403 for "deny" requests, since i have two places where a 403 can be shown, one is any IP from a list and the other one is when there is a PHP request in a forbidden directory
IE: show no-php403.html if the request is catched by the first (or any?) case and no-spammers-CN.html if they are catched by its IP
is this possible?
my-site.conf
------------------------------------------------------------------------------------------------------------------------------------------------------------
location ~* ^/(?:cache|uploads)/.*\.(?:pl|php[345]*)$ {
access_log off;
log_not_found off;
return 403; # or 404/403
}
-------------------
custom-deny.conf (included inside all vhosts)
------------------------------------------------------------------------------------------------------------------------------------------------------------
deny 182.136.0.0/16;
error_page 403 /error403.html;
location = /error403.html {
access_log /var/log/nginx/error_403.log;
root /usr/share/nginx/html;
allow all;
ssi on;
}
Thanks!
IE: show no-php403.html if the request is catched by the first (or any?) case and no-spammers-CN.html if they are catched by its IP
is this possible?
my-site.conf
------------------------------------------------------------------------------------------------------------------------------------------------------------
location ~* ^/(?:cache|uploads)/.*\.(?:pl|php[345]*)$ {
access_log off;
log_not_found off;
return 403; # or 404/403
}
-------------------
custom-deny.conf (included inside all vhosts)
------------------------------------------------------------------------------------------------------------------------------------------------------------
deny 182.136.0.0/16;
error_page 403 /error403.html;
location = /error403.html {
access_log /var/log/nginx/error_403.log;
root /usr/share/nginx/html;
allow all;
ssi on;
}
Thanks!