In my /etc/nginx/sites-available/default
file I currently have blocks along the lines of
location /cdn
{
add_header Access-Control-Allow-Origin *;
}
which has worked well - up until now. However, I now find myself creating sub directories below /cdn which throws up CORS errors on the browser when I try to access resources in, say /cdn/appdata/icons
. I could quite easily bung in a few more blocks similar to the one above but targeting /cdn/appdata
etc. However, this would be a short term solution liable to break sooner rather than later.
Is there a way to specify a location block for a folder and ALL its subfolders?