module(wp): add domain and nginx basic location
This commit is contained in:
parent
6a31dcee0b
commit
1402072fd0
1 changed files with 18 additions and 2 deletions
|
@ -25,6 +25,9 @@ in {
|
||||||
disabledModules = [ "services/web-apps/wordpress.nix" ];
|
disabledModules = [ "services/web-apps/wordpress.nix" ];
|
||||||
options.services.wordpress = {
|
options.services.wordpress = {
|
||||||
enable = mkEnableOption "Enable the WordPress module";
|
enable = mkEnableOption "Enable the WordPress module";
|
||||||
|
domain = mkOption {
|
||||||
|
type = types.str;
|
||||||
|
};
|
||||||
wpConfigSecrets = mkOption {
|
wpConfigSecrets = mkOption {
|
||||||
type = types.str;
|
type = types.str;
|
||||||
};
|
};
|
||||||
|
@ -55,8 +58,21 @@ in {
|
||||||
additionalModules = with pkgs.nginxModules; [
|
additionalModules = with pkgs.nginxModules; [
|
||||||
dav cache-purge moreheaders
|
dav cache-purge moreheaders
|
||||||
] ++ optional cfg.enablePageSpeed pagespeed;
|
] ++ optional cfg.enablePageSpeed pagespeed;
|
||||||
# httpConfig = nginxConfig;
|
virtualHosts."${cfg.domain}" = {
|
||||||
# TODO: ajouter les locations pour wordpress
|
root = app.package;
|
||||||
|
index = "index.html index.htm index.php;";
|
||||||
|
locations."/" = {
|
||||||
|
tryFiles = "$uri/index.html $uri $uri/ /index.php?$query_string;";
|
||||||
|
};
|
||||||
|
# fast cgi conf
|
||||||
|
locations."~ [^/]\\.php(/|$)" = {
|
||||||
|
extraConfig = ''
|
||||||
|
fastcgi_split_path_info ^(.+\.php)(/.+)$;
|
||||||
|
fastcgi_pass unix:${phpFpmListen};
|
||||||
|
fastcgi_index index.php;
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
systemd.services.init-writeable-paths = {
|
systemd.services.init-writeable-paths = {
|
||||||
|
|
Loading…
Add table
Reference in a new issue