Answer the question
In order to leave comments, you need to log in
How to exclude a directory from their rewrite (nginx)?
Good day. There is the next rewrite, everything without a slash except POST.
if ($request_method != "POST"){
rewrite ^/(.*)\/$ /$1 permanent;
}
location / {
try_files $uri $uri/ /index.php?$args;
allow 127.0.0.1;
allow 192.168.0.11
deny all;
error_page 403 = @403;
}
location @403 {
keepalive_timeout 0;
return 503;
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question