'Hide server info using gke ingress
We have a GKE instance where we are using an GCE class ingress, now we have a requirement to hide server info in response headers, there is any way to do that?
Solution 1:[1]
While you cannot directly configure response header manipulation using the BackendConfig resource or annotation on Service or Ingress, you can actually modify the underlying HTTP load balancer created by GCE Ingress:
gcloud compute backend-services update BACKEND_SERVICE_NAME
--custom-response-header='server:'
You'll need to inspect the load balancer that was created in order to get the BACKEND_SERVICE_NAME, but at least you can do it.
Solution 2:[2]
IIS is a Microsoft server. Please have a look at this Doc.
Customizing GKE Ingress Configurations refer to this GCP docs.
apiVersion:cloud.google.com/v1
Kind: BackendConfig
Metadata:
Name: my-backendconfig
Spec:
customRequestHeaders:
Headers:
-”X-Client-Region:{client_region}”
-”X-Client-City:{client_city}”
-”X-Client-CityLatLong:{client_city_long}”
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | |
| Solution 2 | Abhijith Chitrapu |
