Your config seems correct at a first glance. First of all make sure that your EDGE nginx has reloaded that config after you changed it, and make sure to reload Kong as well.
If that doesn’t work, you will have to debug the problem. I would recommend starting by adding a logging plugin to Kong (you could use file-log, or any other logging plugin if it suits you better) so you can see which requests Kong is receiving, and especially the headers.
If you can’t find the issue that way, you should do something similar with your EDGE machine, although the process might be more involved - it might involve manually changing your config to write down requests in your logs.
If you still can’t find the problem after that, please include a sample of each here- the headers in particular should be particularly useful.
I’ll give it a try with file logging and see what happens. I tried on EDGE to set the response header with the same values as the proxy ones and I got the expected header values.
But I’ll check with the file log and I’ll let you know.
Hi @kikito for some reason the header was not reaching Kong. Those directives are set under http namespace but it seems to work only when I add to location / {} block. Do you have any idea why this can happen?
I thought that by adding to http {} block it would apply to everything below it.
Hi all,
I am using kong in kubernetes, how to modify the nginx configuration in kubernetes.
i have to modify x-forwarded setting for getting client ip.
please let know how to proceed in kubernetes.