-
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
Kong Docker header_filter_by_lua_block custom configuration #1842
Comments
The issue you refer to is based on an older Kong version using a YAML configuration format. What they did was customizing the Kong handler. But you placed it in the generic nginx config file template (the new format uses two files). At the bottom of the file there is;
The Kong configuration is in that file see also https://getkong.org/docs/0.9.x/configuration/#custom-nginx-configuration-amp-embedding-kong |
Ah OK, I see - thanks. So I'll have to inline the nginx-kong.conf and not include it - so that I can add to the I can make that work no worries, I'll have to alter my docker build process but that's fine. I'll have a shot at it and post my results here. Cheers. |
@Tieske That works all good - thanks! What I did was start the Kong docker image, then from the container made a copy of nginx-kong.conf and use it as a template in a custom docker build. The complete configuration looks like:
and the /opt/kong/kong_nginx.template is:
I'll just have to be aware moving forward with newer versions of Kong to keep the nginx-kong.conf file up to date. |
glad it works. Maybe @thibaultcha knows an easier way of achieving this? |
@rudijs You can inline the Kong part of the Nginx configuration inside the main part (the template, not the "compiled" version), and use that whole Nginx config file when starting Kong: That is currently the only way (still more flexible than previous versions of Kong) although we could improve this system. |
Hi,
I'm using the offical Kong docker image and trying to remove the Via and X-Kong* headers.
I've gained some insight from this closed issue: #1315
I'm using a custom configuration with the method described in the docs: https://getkong.org/docs/0.9.x/configuration/#custom-nginx-configuration
The custom configuration is working well, I have custom log format and logging to stdout.
I think I'm adding the header_filter_by_lua_block block in the wrong place as it's having no effect.
I've tried a few different places for the header_filter_by_lua_block block without joy.
Can you see from my configuration below where I'm going wrong?
Any tips or suggestions here very much appreciated.
Thanks!
Additional Details & Logs
The text was updated successfully, but these errors were encountered: