mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-06-12 04:35:41 +03:00
nixos/lasuite-docs: fix media proxying
This commit is contained in:
parent
646b910504
commit
39fe05dec0
1 changed files with 4 additions and 3 deletions
|
@ -9,6 +9,7 @@ let
|
|||
inherit (lib)
|
||||
getExe
|
||||
mapAttrs
|
||||
match
|
||||
mkEnableOption
|
||||
mkIf
|
||||
mkPackageOption
|
||||
|
@ -32,6 +33,8 @@ let
|
|||
toString value
|
||||
) cfg.settings;
|
||||
|
||||
proxySuffix = if match "unix:.*" cfg.bind != null then ":" else "";
|
||||
|
||||
commonServiceConfig = {
|
||||
RuntimeDirectory = "lasuite-docs";
|
||||
StateDirectory = "lasuite-docs";
|
||||
|
@ -476,10 +479,9 @@ in
|
|||
};
|
||||
|
||||
locations."/media-auth" = {
|
||||
proxyPass = "http://${cfg.bind}";
|
||||
proxyPass = "http://${cfg.bind}${proxySuffix}/api/v1.0/documents/media-auth/";
|
||||
recommendedProxySettings = true;
|
||||
extraConfig = ''
|
||||
rewrite $/(.*)^ /api/v1.0/documents/$1 break;
|
||||
proxy_set_header X-Original-URL $request_uri;
|
||||
proxy_pass_request_body off;
|
||||
proxy_set_header Content-Length "";
|
||||
|
@ -489,7 +491,6 @@ in
|
|||
|
||||
locations."/media/" = {
|
||||
proxyPass = cfg.s3Url;
|
||||
recommendedProxySettings = true;
|
||||
extraConfig = ''
|
||||
auth_request /media-auth;
|
||||
auth_request_set $authHeader $upstream_http_authorization;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue