Fix Wallabag service

This commit is contained in:
coolneng 2021-02-03 05:28:10 +01:00
parent c12fdc15de
commit d91f26bbe1
Signed by: coolneng
GPG Key ID: 9893DA236405AF57
2 changed files with 26 additions and 15 deletions

View File

@ -16,12 +16,17 @@
user = "nginx"; user = "nginx";
group = "nginx"; group = "nginx";
settings = { settings = {
"pm" = "dynamic"; "listen.owner" = config.services.nginx.user;
"pm.start_servers" = 2; "listen.group" = config.services.nginx.group;
"listen.mode" = 600;
"pm" = "ondemand";
"pm.max_children " = 4; "pm.max_children " = 4;
"pm.min_spare_servers " = 2;
"pm.max_spare_servers" = 4;
"pm.max_requests" = 32; "pm.max_requests" = 32;
"env[WALLABAG_DATA]" = "/var/lib/wallabag";
}; };
phpEnv."PATH" = lib.makeBinPath [ pkgs.php ];
}; };
# Set environment variable pointing to wallabag configuration directory
environment.variables.WALLABAG_DATA = "/var/lib/wallabag";
} }

View File

@ -109,18 +109,24 @@
}; };
}; };
"wallabag.coolneng.duckdns.org" = { "wallabag.coolneng.duckdns.org" = {
enableACME = true;
forceSSL = true;
root = "${pkgs.wallabag}/web"; root = "${pkgs.wallabag}/web";
locations."/" = { tryFiles = "$uri /app.php$is_args$args"; }; locations = {
locations."~ ^/app.php(/|$)" = { "/".tryFiles = "$uri /app.php$is_args$args";
extraConfig = '' "/assets".root = "${config.environment.variables.WALLABAG_DATA}/web";
include ${pkgs.nginx}/conf/fastcgi.conf; "~ ^/app.php(/|$)" = {
fastcgi_pass unix:/run/phpfpm/wallabag.sock; fastcgiParams = {
fastcgi_split_path_info ^(.+\.php)(/.*)$; SCRIPT_FILENAME = "${pkgs.wallabag}/web/$fastcgi_script_name";
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; DOCUMENT_ROOT = "${pkgs.wallabag}/web";
fastcgi_param WALLABAG_DATA /var/lib/wallabag/app; };
fastcgi_param DOCUMENT_ROOT $realpath_root; extraConfig = ''
internal; fastcgi_pass unix:${config.services.phpfpm.pools.wallabag.socket};
''; fastcgi_split_path_info ^(.+\.php)(/.*)$;
include ${pkgs.nginx}/conf/fastcgi_params;
internal;
'';
};
}; };
}; };
}; };