Background So I\'ve got a server running a tomcat application hidden behind an Apache proxy. The proxy provides a more user friendly url as well as SSL
You can use the map directive to rewrite your header:
map
map $upstream_http_locationafterlogon $new_location { ~regexp new_value; } proxy_hide_header LocationAfterLogon; add_header LocationAfterLogon $new_location;
See the documentation: http://nginx.org/en/docs/http/ngx_http_map_module.html