blueberry
Basic Pleskian
Hi,
I have a problem with additional nginx directives. Some location blocks are ignored by Nginx.
"Location =" does work but location (regex) (when involving a folder) does not work. I have performed some test on my test domain inadoo.com
I have entered the following code in additional nginx directives:
The following should return a 403 for example according to the last regex directive but it returns a 404.
Is my formatting wrong?
I also added:
I have a problem with additional nginx directives. Some location blocks are ignored by Nginx.
"Location =" does work but location (regex) (when involving a folder) does not work. I have performed some test on my test domain inadoo.com
I have entered the following code in additional nginx directives:
JavaScript:
location = /page321/ {
deny all; # returns 403 it works. e.g: https://inadoo.com/page321/
}
location /page322/ {
deny all; # it should return a 403 too but it does not work. It returns a 404 E.g: https://inadoo.com/page322/
}
location ~* .(page\/[0-9]+\/)$ {
deny all; # https://inadoo.com/page/1/ among other should return a 403 but it does not work
}
The following should return a 403 for example according to the last regex directive but it returns a 404.
jojo@DESKTOP-KC3T7B7:~$ curl https://inadoo.com/page/32/ -I
HTTP/2 404
server: nginx
date: Thu, 05 Nov 2020 09:11:37 GMT
content-type: text/html; charset=UTF-8
vary: Accept-Encoding
x-powered-by: PHP/7.4.12
expires: Wed, 11 Jan 1984 05:00:00 GMT
cache-control: no-cache, must-revalidate, max-age=0
link: <https://inadoo.com/wp-json/>; rel="REST API Handbook | WordPress Developer Resources"
Is my formatting wrong?
I also added:
Code:
location ~* /(media|images|cache|tmp|logs)/.*.(php|jsp|pl|py|asp|cgi|sh)$ {
return 403; # i tested https://inadoo.com/media/bloup.php but it does not return a 403
}
Last edited: