mirror of
https://git.sr.ht/~rouven/nixos-config
synced 2025-04-25 16:08:30 +02:00
nuc: switch to caddy
This commit is contained in:
parent
6e82ae5be8
commit
657ae1385e
10 changed files with 69 additions and 98 deletions
|
@ -31,21 +31,16 @@ in
|
|||
}
|
||||
'';
|
||||
};
|
||||
services.nginx.virtualHosts."${domain}" = {
|
||||
locations."/" = {
|
||||
proxyPass = "http://unix:/run/seahub/gunicorn.sock";
|
||||
};
|
||||
locations."/seafhttp" = {
|
||||
proxyPass = "http://127.0.0.1:${toString config.services.seafile.seafileSettings.fileserver.port}";
|
||||
extraConfig = ''
|
||||
rewrite ^/seafhttp(.*)$ $1 break;
|
||||
'';
|
||||
};
|
||||
locations."/media" = {
|
||||
root = pkgs.seahub;
|
||||
};
|
||||
locations."/accounts/login" = {
|
||||
return = "301 /oauth/login";
|
||||
};
|
||||
};
|
||||
services.caddy.virtualHosts."${domain}".extraConfig = ''
|
||||
redir /accounts/login /oauth/login
|
||||
reverse_proxy unix//run/seahub/gunicorn.sock
|
||||
route /media/* {
|
||||
root '${pkgs.seahub}'
|
||||
}
|
||||
|
||||
route /seafhttp/* {
|
||||
uri strip_prefix /seafhttp
|
||||
reverse_proxy 127.0.0.1:${toString config.services.seafile.seafileSettings.fileserver.port}
|
||||
}
|
||||
'';
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue