normally, your backend server should do the redirect in a relative URL, unless you really want to redirect to another host. That's something like
sendRedirct("/redirectTo/anotherPath");
In this way, the backend server will send redirect URL with the HOST header specified in the request. In your case, it should be:
Location: http://mybackendserver:8080/redirectTo/anotherPath
If you don't use "proxy_add_header Host xxxx", nginx will the argument specified in "proxy_pass" as the Host to the backend. And in this case, the config:
proxy_redirect default;
Or
proxy_redirect http://mybackendserver:8080/ /;
will automatically handle everything.
If you insist to let the backend server do the FULL URL redirection, you have to manually specify all possible proxy_redirect like this:
proxy_redirect <FULL URL 1> /;
proxy_redirect <FULL URL 2> /;
...
By the way, the first argument of "proxy_redirect" doesn't support var. If you specify a var, nginx doesn't recognize it, and doesn't report an error too. It just considers it as literal.