fix(castopod): Add support for HEAD requests using an nginx trick

This commit is contained in:
sinavir 2023-11-08 22:31:03 +01:00
parent 0a65b4894f
commit d0c6caac7c

View file

@ -266,7 +266,7 @@ new file mode 100644
index 00000000000000..b782b548914795
--- /dev/null
+++ b/nixos/modules/services/audio/castopod.nix
@@ -0,0 +1,287 @@
@@ -0,0 +1,297 @@
+{ config, lib, pkgs, ... }:
+let
+ cfg = config.services.castopod;
@ -522,6 +522,14 @@ index 00000000000000..b782b548914795
+ index index.php index.html;
+ '';
+
+ locations."@force_get" = {
+ extraConfig = ''
+ recursive_error_pages on;
+ proxy_method GET;
+ proxy_pass https://podcasts.dgnum.eu;
+ '';
+ };
+
+ locations."^~ /${cfg.settings."media.root"}/" = {
+ root = cfg.settings."media.storage";
+ extraConfig = ''
@ -536,6 +544,8 @@ index 00000000000000..b782b548914795
+ SERVER_NAME = "$host";
+ };
+ extraConfig = ''
+ error_page 550 = @force_get;
+ if ($request_method = HEAD) { return 550; }
+ fastcgi_intercept_errors on;
+ fastcgi_index index.php;
+ fastcgi_pass unix:${fpm.socket};