now nginx has a list headers_in in ngx_http_request_t, my requirement to is do some change for example encoding to one of the header, I need do this in source code, it seemes a little like the proxy_set_header command in configuration. Directly set value in the table_elt_t seems rude, Does any one has any idea?
How to edit the request header in nginx and then send to backend?
686 views Asked by Hintom At
1
You can modifying the request header by adding a new header to the upstream request and including string captures. Here's a simple example that replaces
Mozilla/5.0
withMozilla/6.0
in the User-Agent header:Although, it sounds like you also want to apply some programatic transformation to your replaced header (you mention "encoding"), which I don't think is possible. There might be a different solution if you explain your problem in more detail with examples.