feat: added default error pages to apache httpd configuration
This commit is contained in:
parent
8028146c1c
commit
302605b8c6
4 changed files with 39 additions and 8 deletions
6
flake.lock
generated
6
flake.lock
generated
|
|
@ -179,11 +179,11 @@
|
|||
"dotfiles": {
|
||||
"flake": false,
|
||||
"locked": {
|
||||
"lastModified": 1760302953,
|
||||
"narHash": "sha256-I6Fwz8j/HIfRO4sVuke2gEeP3QcIfMHWe0nIpnvkbcE=",
|
||||
"lastModified": 1761185022,
|
||||
"narHash": "sha256-SABEm3rOGNy8IXuccUAV/xzJfGaDhuwDk0KNK9WCZE4=",
|
||||
"owner": "c4patino",
|
||||
"repo": "dotfiles",
|
||||
"rev": "d833a91512d9d7708f85f95e4115c2b17f5e3a60",
|
||||
"rev": "0aff829c0ff6e7ae7530fc4dbcbca8a0a6ba849c",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
|
|
|
|||
|
|
@ -1 +1 @@
|
|||
Subproject commit d833a91512d9d7708f85f95e4115c2b17f5e3a60
|
||||
Subproject commit 0aff829c0ff6e7ae7530fc4dbcbca8a0a6ba849c
|
||||
|
|
@ -76,14 +76,31 @@ in {
|
|||
|
||||
extraModules = ["proxy" "proxy_http" "rewrite"];
|
||||
|
||||
extraConfig = ''
|
||||
ErrorDocument 400 /400.html
|
||||
ErrorDocument 401 /401.html
|
||||
ErrorDocument 403 /403.html
|
||||
ErrorDocument 404 /404.html
|
||||
ErrorDocument 500 /500.html
|
||||
'';
|
||||
|
||||
virtualHosts = mkMerge [
|
||||
{
|
||||
"_default_" = {
|
||||
acmeRoot = null;
|
||||
documentRoot = "/var/empty";
|
||||
|
||||
servedDirs = [
|
||||
{
|
||||
dir = "/var/www/error";
|
||||
urlPath = "/";
|
||||
}
|
||||
];
|
||||
|
||||
extraConfig = ''
|
||||
RewriteEngine On
|
||||
RewriteRule ^ - [R=404,L]
|
||||
RewriteCond %{REQUEST_URI} !^/(400|401|403|404|500)\.html$
|
||||
RewriteRule ^ - [L,R=404]
|
||||
'';
|
||||
};
|
||||
}
|
||||
|
|
@ -98,12 +115,21 @@ in {
|
|||
acmeRoot = null;
|
||||
serverAliases = ["*.localhost"];
|
||||
documentRoot = "/var/empty";
|
||||
|
||||
servedDirs = [
|
||||
{
|
||||
dir = "/var/www/error";
|
||||
urlPath = "/";
|
||||
}
|
||||
];
|
||||
|
||||
extraConfig = ''
|
||||
UseCanonicalName Off
|
||||
|
||||
RewriteEngine On
|
||||
${localhostProxyConfig}
|
||||
|
||||
RewriteRule ^ - [R=404,L]
|
||||
RewriteCond %{REQUEST_URI} !^/(400|401|403|404|500)\.html$
|
||||
RewriteRule ^ - [L,R=404]
|
||||
'';
|
||||
};
|
||||
}
|
||||
|
|
@ -141,6 +167,8 @@ in {
|
|||
|
||||
networking.firewall.allowedTCPPorts = [80 443];
|
||||
|
||||
${namespace}.services.storage.impermanence.folders = ["/var/www"];
|
||||
systemd.tmpfiles.rules = [
|
||||
"L+ /var/www 555 root root - ${inputs.dotfiles + "/httpd"}"
|
||||
];
|
||||
};
|
||||
}
|
||||
|
|
|
|||
|
|
@ -27,6 +27,9 @@ in {
|
|||
hardware.nvidia = enabled;
|
||||
|
||||
services = {
|
||||
networking = {
|
||||
httpd = enabled;
|
||||
};
|
||||
storage = {
|
||||
nfs.mounts = {
|
||||
"slurm" = "chibi";
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue