Prevent AWS ELB from setting x-forwarded-proto

amazon-elbamazon-web-services

I have the following setup:

  1. Public facing ELB, sends request to ->
  2. Nginx instance, sends request to ->
  3. internal ELB, sends request to ->
  4. node server

I'm trying to switch to Application ELBs because of its advantages over classic ELBs, but it only supports HTTP/HTTPS handlers, not TCP like I was using before, and when using App ELBs #3 seems to overwrite the x-forwarded-proto header being set by Nginx in #2.

My node server in #4 is what performs 301 redirects for enforcing https (since we also do path redirection in node, we do protocol redirection in node at the same time in order to shorten our redirect chains).

Is there a way to prevent the ELB in #3 from setting x-forwarded-proto?

Best Answer

No, or at least not yet. X-Forwarded-Proto and X-Forwarded-For headers are added by design for all HTTP/S listeners.

Related Topic