nixos/pretalx: fix /media/ nginx location block

Fix the alias for displaying media.
Also the more_set_headers for Content-Disposition was invalid and broke
browsers. While I was at it, I also quoted the other more_set_headers
directives.
This commit is contained in:
Sandro Jäckel 2024-03-12 10:04:07 +01:00
parent 4b302c132d
commit 8f86f82b1a
No known key found for this signature in database
GPG Key ID: 3AF5A43A3EECC2E5
1 changed files with 4 additions and 4 deletions

View File

@ -286,16 +286,16 @@ in
virtualHosts.${cfg.nginx.domain} = {
# https://docs.pretalx.org/administrator/installation.html#step-7-ssl
extraConfig = ''
more_set_headers Referrer-Policy same-origin;
more_set_headers X-Content-Type-Options nosniff;
more_set_headers "Referrer-Policy: same-origin";
more_set_headers "X-Content-Type-Options: nosniff";
'';
locations = {
"/".proxyPass = "http://pretalx";
"/media/" = {
alias = "${cfg.settings.filesystem.data}/data/media/";
alias = "${cfg.settings.filesystem.data}/media/";
extraConfig = ''
access_log off;
more_set_headers Content-Disposition 'attachment; filename="$1"';
more_set_headers 'Content-Disposition: attachment; filename="$1"';
expires 7d;
'';
};