I cannot debug this piece of nginx configuration:
I want to add some headers to all requests for a .pdf
file
Then I want to remove a token which I add to my veiw directory to avoid unwanted browser's cache:
location /static {
location ~* \.pdf$ {
add_header Access-Control-Allow-Origin *;
add_header Content-Disposition 'inline';
}
#Remove Anti cache token
rewrite "^/static[0-9]{10}/(.*)$" /static/$1 last;
...
}
There is no nginx syntax error but requesting a .pdf
for shows a 404 not found error means that rewrite doesn't apply on the request.
Any help is very appreciated
Thank you