-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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
Add configuration flag to hide kong headers #1009
Comments
+1 |
This also overlaps with #324, just in case someone is looking into it. |
I suspect others have already found work arounds for this but the simplest I have found is to add the following statements to the
|
Where would this go in the kong.conf for 0.9.1? |
Try modifying /usr/local/share/lua/5.1/kong/templates/kong/templates/nginx_kong.lua and restart Kong. |
Hmm we run Kong on EC2 instances and simply install the kong rpm. Of course we can write some script, package it and let it do this modification. But it would be nice if there is a cleaner way. |
The response transfer plugin can only remove the @elruwen You can have a look at #1842 (comment) perhaps this is a better way to solve it. |
…cy tokens * Add server_tokens and latency_tokens Kong configuration properties. Fix #1009
I tried adding above mentioned configuration nginx_kong.conf file and restarted the kong server in the meanwhile the file got overwritten with the default configuration and my changes disappeared. |
We are doing currently the following: There is the file /usr/local/share/lua/5.1/kong/templates/nginx.lua (the exact path might be different on your system). We added to the http section the following lines:
|
I found a solution for Kong 1.4.X (using database deployment, meaning there's no kong.yaml) Execute elruwen's solution by editing the following file:
You will find something like this:
Modify it by adding elruwnen's line, like this (if you add the line server_tokens off; kong won't start):
Go and edit your kong.conf file:
Search for the headers section and edit it: From this:
to this:
restart kong |
How to remove the headers server:0.13.1 version |
How to remove the headers Server: kong/2.0.0 and use our own certificat in nginx |
@Tryptich @Kishorelk See the documentation for the It shouldn't be necessary to edit the nginx template, editing |
Hi!
If I currently do a kong request, the response contains the following headers:
'server': 'Apache-Coyote/1.1',
'via': 'kong/0.6.1',
'x-kong-proxy-latency': '0',
'x-kong-upstream-latency': '79'}
Server is the value from the upstream server, the rest is set by kong. While this is nice for debugging, I would prefer to hide those values from the public.
I would be nice to have a configuration flag to turn the exposure off.
Cheers
Ruwen
The text was updated successfully, but these errors were encountered: