I am using nginx 1.14.0 on Ubuntu.
I want to remove trailing slash with every URL's coming after https://www.example.com/en/authors/*
or https://www.example.com/de/bloggers/*
So anyone goes to https://www.example.com/en/authors/hello/
should be redirected to https://www.example.com/en/authors/hello
or https://www.example.com/de/bloggers/hello/
to https://www.example.com/de/bloggers/hello
and likewise...
I tried some patterns based on this answer but seems like it does not fit in my situation since I want all trailing slash removed from only after /en/authors/*
or /de/bloggers/*
and it may involve wildcard as well
One of the patterns I tried is rewrite ^/(?!authors|bloggers)(.*)/$ /$1 permanent;
but it did not work