Убрать слеш в конце ссылки. NGINX
При переходе site.ru/about кидает на site.ru/about/. Как убрать автоматическую подстановку слеш в конце ссылки в настройках NGINX, что бы было так site.ru/about Вот мой конфиг:
server {
server_name sub.url.ru;
root /home/suburl/public_html/;
index index.php;
access_log /home/sportmen/sportmen.ru/logs/access.log;
error_log /home/sportmen/sportmen.ru/logs/error.log;
location ~ \.php$ {
include /etc/nginx/fastcgi_params;
fastcgi_pass unix:/var/run/php/php7.4-fpm.sock;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_intercept_errors on; }
if ($request_uri ~ ^(.*)/index.(html|php)) { return 301 $1/$is_args$args; }
location / { try_files $uri $uri/ /bitrix/urlrewrite.php$is_args$args; }
location ~* @.*\.html$ { internal; }
include /etc/nginx/vhosts-includes/suburl/redirect.conf;
listen 443 ssl; # managed by Certbot
ssl_certificate /etc/letsencrypt/live/suburl/fullchain.pem; # managed by Certbot
ssl_certificate_key /etc/letsencrypt/live/suburl/privkey.pem; # managed by Certbot
include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot
ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot
###phpMyadmin###
location /phpmy123 {
alias /usr/share/phpmyadmin;
location ~ \.php$ {
fastcgi_pass unix:/run/php/php7.4-fpm.sock;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $request_filename;
include fastcgi_params;
fastcgi_ignore_client_abort off;
}
location ~* \.(js|css|png|jpg|jpeg|gif|ico)$ {
access_log off;
log_not_found off;
expires 1M;
}
}
location ~ \.php$ {
fastcgi_pass unix:/var/run/php/php7.4-fpm.sock;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
}
###end-phpMyAdmin###
server {
if ($host = sub.url.ru) {
return 301 https://$host$request_uri;
} # managed by Certbot
listen 80;
server_name sub.url.ru;
return 404; # managed by Certbot
Если я добавляю:
if (!-f $request_filename) {
rewrite ^/(.*)/$ /$1 permanent;
}
То он начинает делать цикличное перенаправление на странице. Как убрать слеш в конце ссылок?