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