mirror of
https://github.com/seanmorley15/AdventureLog.git
synced 2025-07-21 13:59:36 +02:00
fix: update location blocks for protected media in nginx configuration
This commit is contained in:
parent
c159e176b3
commit
f95afdc35c
1 changed files with 4 additions and 6 deletions
|
@ -30,10 +30,9 @@ http {
|
||||||
}
|
}
|
||||||
|
|
||||||
# Special handling for PDF files with CSP headers
|
# Special handling for PDF files with CSP headers
|
||||||
location ~ ^/protectedMedia/.*\.pdf$ {
|
location ~ ^/protectedMedia/(.*)\.pdf$ {
|
||||||
internal;
|
internal;
|
||||||
alias /code/media/;
|
alias /code/media/$1.pdf;
|
||||||
try_files $uri =404;
|
|
||||||
add_header Content-Security-Policy "default-src 'self'; script-src 'none'; object-src 'none'; base-uri 'none'" always;
|
add_header Content-Security-Policy "default-src 'self'; script-src 'none'; object-src 'none'; base-uri 'none'" always;
|
||||||
add_header X-Content-Type-Options nosniff always;
|
add_header X-Content-Type-Options nosniff always;
|
||||||
add_header X-Frame-Options SAMEORIGIN always;
|
add_header X-Frame-Options SAMEORIGIN always;
|
||||||
|
@ -41,10 +40,9 @@ http {
|
||||||
}
|
}
|
||||||
|
|
||||||
# General protected media files (non-PDF)
|
# General protected media files (non-PDF)
|
||||||
location /protectedMedia/ {
|
location ~ ^/protectedMedia/(.*)$ {
|
||||||
internal;
|
internal;
|
||||||
alias /code/media/;
|
alias /code/media/$1;
|
||||||
try_files $uri =404;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
Loading…
Add table
Add a link
Reference in a new issue