I use AWS CloudFront to interrupt my SSL before hitting my backend, and you need to distinguish this traffic from non-CloudFront traffic in order to set proxy_set_header in Nginx.
I believe the best way to do this is to check the X-Amz-Cf-Id header ( added by CloudFront ) and set proxy_set_header if any. However, I know that it is not possible to set proxy_set_header in a Nginx if statement, which leads to my question.
How to set the value of proxy_set_header only if this header is present?
source share