Edit a header value in nginx

前端 未结 1 544
南方客
南方客 2020-12-31 12:28

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

相关标签:
1条回答
  • 2020-12-31 13:05

    You can use the map directive to rewrite your header:

     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

    0 讨论(0)
提交回复
热议问题