gogs: add error pages
This commit is contained in:
parent
1a1261e0a4
commit
8ad6835a97
1 changed files with 33 additions and 2 deletions
|
@ -1,10 +1,42 @@
|
||||||
{ config, lib, ... }: {
|
{ config, lib, pkgs, ... }:
|
||||||
|
let
|
||||||
|
|
||||||
|
errorPages = pkgs.fetchgit {
|
||||||
|
url = "https://git.ingolf-wagner.de/palo/http-errors.git";
|
||||||
|
rev = "74b8e4c1d9bbba3db6ad858b888e1867318af1f0";
|
||||||
|
sha256 = "0czdzafx4k76q773lyf3vsjm74g1995iz542dhw15kpy5xbivsrg";
|
||||||
|
};
|
||||||
|
|
||||||
|
error = {
|
||||||
|
extraConfig = ''
|
||||||
|
error_page 400 /errors/400.html;
|
||||||
|
error_page 401 /errors/401.html;
|
||||||
|
error_page 402 /errors/402.html;
|
||||||
|
error_page 403 /errors/403.html;
|
||||||
|
error_page 404 /errors/404.html;
|
||||||
|
error_page 405 /errors/405.html;
|
||||||
|
error_page 406 /errors/406.html;
|
||||||
|
error_page 500 /errors/500.html;
|
||||||
|
error_page 501 /errors/501.html;
|
||||||
|
error_page 502 /errors/502.html;
|
||||||
|
error_page 503 /errors/503.html;
|
||||||
|
error_page 504 /errors/504.html;
|
||||||
|
'';
|
||||||
|
locations."^~ /errors/" = {
|
||||||
|
extraConfig = "internal;";
|
||||||
|
root = "${errorPages}/";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
in
|
||||||
|
{
|
||||||
|
|
||||||
services.nginx = {
|
services.nginx = {
|
||||||
enable = true;
|
enable = true;
|
||||||
statusPage = true;
|
statusPage = true;
|
||||||
virtualHosts = {
|
virtualHosts = {
|
||||||
"git.${config.networking.hostName}.private" = {
|
"git.${config.networking.hostName}.private" = {
|
||||||
|
extraConfig = error.extraConfig;
|
||||||
locations."/" = {
|
locations."/" = {
|
||||||
proxyPass = "http://${config.networking.hostName}.private:${
|
proxyPass = "http://${config.networking.hostName}.private:${
|
||||||
toString config.services.gogs.httpPort
|
toString config.services.gogs.httpPort
|
||||||
|
@ -44,7 +76,6 @@
|
||||||
};
|
};
|
||||||
backup.all.restic.dirs = [ config.services.gogs.repositoryRoot ];
|
backup.all.restic.dirs = [ config.services.gogs.repositoryRoot ];
|
||||||
|
|
||||||
|
|
||||||
#services.gitea = {
|
#services.gitea = {
|
||||||
# enable = true;
|
# enable = true;
|
||||||
# appName = "Git";
|
# appName = "Git";
|
||||||
|
|
Loading…
Reference in a new issue