Skip to main content
  1. How To/

Nginx Ingress Controller forward headers

·100 words·1 min
Ravi Singh
Author
Ravi Singh
Software engineer with 15+ years building backend systems and cloud platforms across fintech, automotive, and academia. I write about the things I build, debug, and learn — so I don’t forget them.
Table of Contents

Error
#

While moving to kubernetes, and migrating spring boot apps, we encountered a strange behavior that few of the webpages served by freemarker templates in spring boot were adding port :8080 instead of just using the hostname with SSL port :443

Fix
#

After some investigation and trying to find some workaround, we found out that X-Forwarded-* headers needs to be forwarded by nginx ingress controller when it’s behind an azure app gateway(L7 load balancer).

And nginx ingress controller wasn’t configured to forward the header. So we needed to enable use-forwarded-headers in configmap for nginx configuration.

Links#


Discussion