N
N
Nikita Dergachov2017-08-24 12:32:10
Nginx
Nikita Dergachov, 2017-08-24 12:32:10

How to add header for nginx svg files?

Good afternoon, I need to add the header Access-Control-Allow-Origin "*" for all files with svg format.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
P
Puma Thailand, 2017-08-24
@vanillathunder

like this
location ~ \.(js|css|png|jpg|jpeg|gif|ico|html|woff|woff2|ttf|svg|eot|otf)$ {
add_header "Access-Control-Allow-Origin" "* ";
add_header Cache-Control "public";
}

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question