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