audiobookshelf: fix websockets and CSP

This commit is contained in:
Katherina Walshe-Grey 2024-11-09 01:05:55 +00:00
parent b893da35be
commit 9b63a5e56f
2 changed files with 9 additions and 2 deletions

View file

@ -9,7 +9,7 @@
appendHttpConfig = '' appendHttpConfig = ''
add_header Strict-Transport-Security "max-age=31536000; includeSubdomains; preload" always; add_header Strict-Transport-Security "max-age=31536000; includeSubdomains; preload" always;
add_header Content-Security-Policy "default-src https: data: blob: 'unsafe-inline' 'wasm-unsafe-eval'; object-src 'none'; base-uri 'none';" always; add_header Content-Security-Policy "default-src https: data: blob: ws: 'unsafe-inline' 'wasm-unsafe-eval'; object-src 'none'; base-uri 'self';" always;
add_header Referrer-Policy strict-origin-when-cross-origin; add_header Referrer-Policy strict-origin-when-cross-origin;
add_header X-Frame-Options SAMEORIGIN; add_header X-Frame-Options SAMEORIGIN;
add_header X-Content-Type-Options nosniff; add_header X-Content-Type-Options nosniff;

View file

@ -19,7 +19,14 @@ in
${cfg.domain} = { ${cfg.domain} = {
forceSSL = true; forceSSL = true;
enableACME = true; enableACME = true;
locations."/".proxyPass = "http://127.0.0.1:8234/"; locations."/" = {
proxyPass = "http://127.0.0.1:8234/";
extraConfig = ''
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
'';
};
}; };
}; };
}; };