The problem is that you specify an empty path in your proxy_pass directive. So writing
proxy_pass http://localhost:8082;
would prevent the rewriting/normalization behaviour. The subject is covered in detail here in the documentation of nginx https://nginx.org/en/docs/http/ngx_http_proxy_module.html#proxy_pass