I am facing the similar issue as described here: How to stop nginx 301 auto redirect when trailing slash is not in URI?
Yet in my case the confifuration is a little bit different. I am using the Host header value to set a "virtual domain" that I am passing to the upstream apache. So the redirect should NEVER occur by nginx - the desired behaviour would be just passing the request as it is to the upstream apache. I cannot afford to put the magnitudes of location directive, because it is just too unelegant and cumbersome. Any ideas how to disable nginx redirects while using proxy_pass?
Edit: I wonder if it can be done via proxy_intercept_errors and error_page directives + some handler. It is unclear what should be done in the handler though.. will nginx pass the request upstream if I just declare an empty handler? Or I should specify proxy_pass (as well as all other related options, provided I am using SSL for upstream connection) again?
Edit: eventually decided against the usage of "virtual domain" and just specified a real one (both in the nginx prozy and in upstream apache); at the same time on the upstream apache server I restricted access only to specific IP addresses. It would be nice to understand how to deal with nginx, but there is simply no time for that. :(