uri unescape fix snippets

Fixing how nginx sends request URI to the backend server.

Tagged nginx, uri unescape fix  Languages bash

I needed to send an URI through Nginx to the backend servers (Mongrel) intact. However Nginx was constantly unescaping the URI, and removed slashes in the process. That resulted in an invalid URL at the backend server. The fix was simple, but extremely hard to find. Just remove the trailing slash from the proxy_pass directive, like below.

Invalid URI is sent to the backend server with this configuration of Nginx.

proxy_pass         http://backend1:3000/;

Valid, untampered URI is sent with this configuration of Nginx.

proxy_pass         http://backend1:3000;