server {
    
    # ...
    
    rewrite ^/(.*)/$ /$1 permanent;
    
    # ...
}