HTTP preflight OPTION requests come in a lot and all our system does is reply with some constant headers.

I don't want to fire up my servlet just to find out it's an OPTION request and respond immediately with the required headers.

I'm thinking there should be a way for the load-balancer to do that. Like when I used Apache as a reverse-proxy server to send requests to the Java application server, I think I could easily make it handle the OPTION requests with immediate reply (after all, that's happening on the HTTP layer).

I think it would reduce workload even for the load balancers and the AWS network if they were to spit out the canned reply every time.

Is there any way I can have the AWS load balancer do that?


1 Answer 1


Depending on exactly how you want to respond to these requests, you can use AWS WAF and attach this to the ELB.

Create a custom rule (to block traffic by using "option"): enter image description here

Then create a custom response body for this in the Web ACLs.

Custom response bodies are plain text, JSON, or HTML content that you use to customize a response to blocked requests. You can use a response body anywhere in the web ACL where you create it.

... the downside here is WAF is a pay-for addon but it's not much, depending on your budget.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.