vishak vishak - 2 months ago 23
HTTP Question

How to add Access-Control-Expose-Headers in Nginx server?

I have added

add_header 'Access-Control-Expose-Headers' '*';
in my Nginx server. But still not able to get any response headers.

Answer Source

Somewhere in your server or location block. Please note that * will not be acceptable here. You have to explicitly expose each custom header.

add_header 'Access-Control-Expose-Headers' 'Authorization,X-Custom-Header';