Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

response_headers_to_remove remove server header #14421

Closed
tydurd opened this issue Dec 15, 2020 · 1 comment
Closed

response_headers_to_remove remove server header #14421

tydurd opened this issue Dec 15, 2020 · 1 comment
Labels
area/http question Questions that are neither investigations, bugs, nor enhancements

Comments

@tydurd
Copy link

tydurd commented Dec 15, 2020

Hi team, I have the following envoy configuration (envoy v.1.12.2) and can't find a way to remove 'server' from response headers.

static_resources:
listeners:
- address:
socket_address:
address: 0.0.0.0
port_value: 80
filter_chains:
- filters:
- name: envoy.http_connection_manager
config:
server_name: "demo"
codec_type: auto
stat_prefix: ingress_http
route_config:
response_headers_to_remove:
- server
- x-envoy-upstream-service-time
name: local_route
virtual_hosts:
- name: bookservice
domains:
- "*"
routes:
- match:
prefix: "/"
route:
cluster: localcluster
http_filters:
- name: envoy.router
config: {}
clusters:
- name: localcluster
connect_timeout: 2.25s
type: static
lb_policy: round_robin
hosts:
- socket_address:
address: 127.0.0.1
port_value: 8080
admin:
access_log_path: "/dev/stdout"
address:
socket_address:
address: 0.0.0.0
port_value: 8081

I've tried removing the header both in the virtual host config and route config without success. What am I missing?

@tydurd tydurd added the triage Issue requires triage label Dec 15, 2020
@alyssawilk
Copy link
Contributor

response_headers_to_remove removes headers sent by upstream, but Envoy often adds its own server header.
There's an HCM field "server_header_transformation" - I suspect setting it to PASS_THROUGH may solve your problem.

https://www.envoyproxy.io/docs/envoy/latest/api-v3/extensions/filters/network/http_connection_manager/v3/http_connection_manager.proto.html?highlight=server_header_transformation#envoy-v3-api-enum-extensions-filters-network-http-connection-manager-v3-httpconnectionmanager-serverheadertransformation

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/http question Questions that are neither investigations, bugs, nor enhancements
Projects
None yet
Development

No branches or pull requests

2 participants