Access-Control-Allow-Origin not working for image extensions in Nginx
<p>I have this configuration in nginx to add cross-origin and <strong>its working fine</strong>, the header Allow-Origin is present in response headers:</p>

<pre><code>location ~* \.(woff|woff2|oft|eot|ttf)$ {
        add_header Cache-Control "max-age=1604800";
        add_header Access-Control-Allow-Origin '*';
        log_not_found off;
}
</code></pre>

<p>but when I try to do exactly the same for image extensions its not working, no Allow-Origin header in response headers:</p>

<pre><code>location \.(ico|gif|jpg|jpeg|png|flv|pdf|thumb)$ {
        add_header Cache-Control "max-age=29030400";
        add_header Access-Control-Allow-Origin '*';
        log_not_found off;
}
</code></pre>

<p>Why is not working for images? </p>