remove trailing slash from nginx code example Example: remove trailing slash from nginx rewrite ^/(.*)/$ /$1 permanent;