I am trying to add OPTIONS inside haproxy instead adding it in every rest api. I am using something like this:
acl is_options method OPTIONS
use_backend cors_backend if is_options
backend cors_backend
http-request return status 200
In previous part of haproxy.cfg I added some CORS headers and everything works fine for api calls going to my rest api servers, but when I use cors_backend to send response directly from haproxy, all headers I added above are removed.
Is this expected, is there some way to preserve headers? Maybe it is not good idea to add OPTIONS to haproxy at all