Skip to content

Commit

Permalink
fix(adguardhome): use nginx helper to set up vhost config
Browse files Browse the repository at this point in the history
  • Loading branch information
ajgon committed Nov 3, 2024
1 parent ef1fd64 commit 34ad02d
Showing 1 changed file with 4 additions and 22 deletions.
26 changes: 4 additions & 22 deletions modules/system/apps/adguardhome/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -218,28 +218,10 @@ in
serviceConfig.Group = "services";
};

services.nginx.virtualHosts.adguard = {
useACMEHost = "wildcard.${config.mySystem.rootDomain}";
serverName = "adguard.${config.mySystem.rootDomain}";
forceSSL = true;
locations = {
"/" = {
proxyWebsockets = true;
extraConfig = ''
set $host_to_pass http://127.0.0.1:${builtins.toString config.services.adguardhome.port};
proxy_pass $host_to_pass;
proxy_set_header Host $host;
proxy_set_header X-Original-URL $scheme://$http_host$request_uri;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header X-Forwarded-Host $http_host;
proxy_set_header X-Forwarded-URI $request_uri;
proxy_set_header X-Forwarded-Ssl on;
proxy_set_header X-Forwarded-For $remote_addr;
proxy_set_header X-Real-IP $remote_addr;
'';
};
};
services.nginx.virtualHosts.adguard = svc.mkNginxVHost {
host = "adguard";
proxyPass = "http://127.0.0.1:${builtins.toString config.services.adguardhome.port}";
useAuthelia = config.mySystemApps.authelia.enable;
};

mySystemApps.homepage = {
Expand Down

0 comments on commit 34ad02d

Please sign in to comment.