init
This commit is contained in:
commit
642869ce9b
27 changed files with 1414 additions and 0 deletions
31
modules/caddy.nix
Normal file
31
modules/caddy.nix
Normal file
|
|
@ -0,0 +1,31 @@
|
|||
{ config, hostMeta, ... }:
|
||||
{
|
||||
services.caddy = {
|
||||
enable = true;
|
||||
virtualHosts.${hostMeta.publicDomain}.extraConfig = ''
|
||||
encode zstd gzip
|
||||
|
||||
handle /health {
|
||||
respond "ok" 200
|
||||
}
|
||||
|
||||
${
|
||||
if hostMeta.role == "replica" then
|
||||
''
|
||||
header {
|
||||
X-Wiki-Mode "read-only"
|
||||
}
|
||||
|
||||
''
|
||||
else
|
||||
""
|
||||
}php_fastcgi unix//run/phpfpm/mediawiki.sock {
|
||||
root ${config.services.mediawiki.finalPackage}/share/mediawiki
|
||||
}
|
||||
|
||||
file_server {
|
||||
root ${config.services.mediawiki.finalPackage}/share/mediawiki
|
||||
}
|
||||
'';
|
||||
};
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue