server { listen 8080; absolute_redirect off; rewrite ^(/.*)\.html(\?.*)?$ $1$2 redirect; rewrite ^/(.*)/$ /$1 redirect; root /usr/share/nginx/html; location / { try_files $uri.html $uri/ $uri =404; } location = / { return 302 overview; } }