简体   繁体   中英

Eks ALB Ingress-Controller configure add_header

I currently have a Kubernetes cluster on AWS (EKS). For the ingress I have an ingress controller deployed.

I have a deployment with a pod in which there are two containers. A PHP Container and an Nginx Container. The Nginx container only acts as a proxy and I would like to remove it.

Currently the nginx.conf has the following that I don't know how to pass it to the ALB ingress.

($ request_method = 'POST') {
             add_header 'Access-Control-Allow-Origin' '*';
             add_header 'Access-Control-Allow-Methods' 'GET, POST, OPTIONS';
             add_header 'Access-Control-Allow-Headers' 'DNT, User-Agent, X-Requested-With, If-Modified-Since, Cache-Control, Content-Type, Range';
             add_header 'Access-Control-Expose-Headers' 'Content-Length, Content-Range';

I don't know if it is possible to pass the add_header to the ALB Ingress. Does anyone know if it can be done or if on the contrary it is necessary to install an Nginx Ingress Controller?

Thanks

i think this will help your question. https://gitanswer.com/how-to-config-cors-with-alb-go-aws-load-balancer-controller-485142972 because the alb ingress controller only opens an alb that routes traffic to the service it cannot be done like that. and as you said working with nginx ingress controller will solve your problem.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM