summaryrefslogtreecommitdiff
path: root/hosts/cloud/proxy/authentik.nix
diff options
context:
space:
mode:
Diffstat (limited to 'hosts/cloud/proxy/authentik.nix')
-rw-r--r--hosts/cloud/proxy/authentik.nix31
1 files changed, 31 insertions, 0 deletions
diff --git a/hosts/cloud/proxy/authentik.nix b/hosts/cloud/proxy/authentik.nix
new file mode 100644
index 0000000..c6c9685
--- /dev/null
+++ b/hosts/cloud/proxy/authentik.nix
@@ -0,0 +1,31 @@
+# TODO: integrade with oxalab-wg
+{ config, ... }:
+{
+ # authentik
+ services.nginx.upstreams.authentik = {
+ extraConfig = ''
+ keepalive 10;
+ '';
+ servers =
+ {
+ "10.89.88.2:9000" = { };
+ "[fd31:185d:722f::2]:9000" = { };
+ };
+ };
+
+ services.nginx.virtualHosts."sso.oxapentane.com" = {
+ forceSSL = true;
+ enableACME = true;
+ locations."/" = {
+ proxyWebsockets = true;
+ proxyPass = "http://authentik";
+ extraConfig = ''
+ proxy_set_header X-Forwarded-Proto $scheme;
+ proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
+ proxy_set_header Host $host;
+ proxy_set_header Upgrade $http_upgrade;
+ proxy_set_header Connection $connection_upgrade;
+ '';
+ };
+ };
+ }