Add custom header to Amazon AWS ALB request

23.3k views Asked by At

I would like to add a custom header to the request at the AWS ALB level. I am doing migration of some iRules from F5 to ALB and there are lots of custom iRules written in F5 to add custom headers based on some conditions and I have to keep it like-for-like in order to perform the smoother migration.

Is it possible to do this from the AWS ALB itself?

2

There are 2 answers

0
Maurice On

As far as I know there is no way to set custom headers at the ALB level.

You can however add CloudFront as a CDN in front of it, that allows you to set custom headers, which will then be passed on to the ALB.

2
Marcin On

Is it possible to do this from the AWS ALB itself?

Sadly its not. You could setup lambda function as your target, and proxy everything through lambda:

Client ---> ALB ---> Lambda ---> Instances

But such design has its own drawbacks.