S
S
SteepNET2020-02-20 15:09:56
Nginx
SteepNET, 2020-02-20 15:09:56

Remove slash at the end of nginx request?

Good afternoon!
There is a site whose root looks like this site.ru/site/ The task is to remove this / at the end of this address.
Moreover, there are sections of this kind site.ru/site/internet, and in this case / at the end is already removed.

There are already rules

spoiler
if (!-f $request_filename){
set $rule_2 1$rule_2;
}
if (!-d $request_filename){
set $rule_2 2$rule_2;
}
if (!-e $request_filename){
set $rule_2 3$rule_2;
}
if ($request_filename !~ "-l"){
set $rule_2 4$rule_2;
}
if ($rule_2 = "4321"){
rewrite /(.+) /./index.php?path=$1 last;
}
if ($request_uri ~* "\/\/") {
rewrite ^/(.*) $scheme://$host/$1 permanent;
}


Website on FastCGI (Apache) is proxied by NGINX

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question