Reputation: 11629
I am using nginx in front of apache servers as a load balancer and to log access logs. To log some variables from web services to the nginx log, the services are writing to Http header which gets extracted by nginx. The problem is that these variables are rather internal info which I want to remove before passing back to the client. Is there an easy of removing specific http header line(s) in nginx?
Upvotes: 1
Views: 5837
Reputation: 25721
Which headers are passed from a proxied server to the client that made the request can be controlled with the config entries for proxy_hide_header and proxy_pass_header.
The 'pass' one forces headers that are normally removed to be shown to the client, and the hide one forces headers that are normally shown to be removed.
This allows you to remove or hide headers that you don't want to be shown to the end user.
Upvotes: 2