lol

nixos/lasuite-docs: fix media proxying (#412732)

authored by

Martin Weinelt and committed by
GitHub
d5bbb50a 64ab12ec

+4 -3
+4 -3
nixos/modules/services/web-apps/lasuite-docs.nix
··· 9 9 inherit (lib) 10 10 getExe 11 11 mapAttrs 12 + match 12 13 mkEnableOption 13 14 mkIf 14 15 mkPackageOption ··· 31 32 else 32 33 toString value 33 34 ) cfg.settings; 35 + 36 + proxySuffix = if match "unix:.*" cfg.bind != null then ":" else ""; 34 37 35 38 commonServiceConfig = { 36 39 RuntimeDirectory = "lasuite-docs"; ··· 476 479 }; 477 480 478 481 locations."/media-auth" = { 479 - proxyPass = "http://${cfg.bind}"; 482 + proxyPass = "http://${cfg.bind}${proxySuffix}/api/v1.0/documents/media-auth/"; 480 483 recommendedProxySettings = true; 481 484 extraConfig = '' 482 - rewrite $/(.*)^ /api/v1.0/documents/$1 break; 483 485 proxy_set_header X-Original-URL $request_uri; 484 486 proxy_pass_request_body off; 485 487 proxy_set_header Content-Length ""; ··· 489 491 490 492 locations."/media/" = { 491 493 proxyPass = cfg.s3Url; 492 - recommendedProxySettings = true; 493 494 extraConfig = '' 494 495 auth_request /media-auth; 495 496 auth_request_set $authHeader $upstream_http_authorization;