nginx configuration variable interpolation

Vilius Šumskas vilius.sumskas at
Mon Mar 27 15:24:06 UTC 2023


I have the following directive in Nginx configuration:

location /docs {
    add_header Access-Control-Allow-Origin $cors_origin;

$cors_origin comes from the map {} where the value is set to * or something else.

I have noticed that if $cors_origin is set to 0, add_header doesn’t add Access-Control-Allow-Origin header at all. Is this expected? I don’t see anything about such behaviour in the add_header documentation.

   Best Regards,


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the nginx mailing list