I have the following nginx configuration:
location ~* ^/path/(.*) { set $query $1; proxy_pass http://backend_app/$query; proxy_set_header Host $http