forked from CCCHH/nix-infra
Add and configure new Git server using Forgejo
This commit is contained in:
parent
26132b1526
commit
ec5430ee34
7 changed files with 182 additions and 0 deletions
41
config/hosts/git/nginx.nix
Normal file
41
config/hosts/git/nginx.nix
Normal file
|
@ -0,0 +1,41 @@
|
|||
# Sources for this configuration:
|
||||
# - https://forgejo.org/docs/latest/admin/reverse-proxy/
|
||||
|
||||
{ config, pkgs, ... }:
|
||||
|
||||
{
|
||||
services.nginx = {
|
||||
enable = true;
|
||||
|
||||
virtualHosts."git.hamburg.ccc.de" = {
|
||||
default = true;
|
||||
forceSSL = true;
|
||||
enableACME = true;
|
||||
|
||||
listen = [
|
||||
{
|
||||
addr = "0.0.0.0";
|
||||
port = 80;
|
||||
}
|
||||
{
|
||||
addr = "0.0.0.0";
|
||||
port = 443;
|
||||
ssl = true;
|
||||
}
|
||||
];
|
||||
|
||||
locations."/" = {
|
||||
proxyPass = "${config.services.forgejo.settings.server.PROTOCOL}://${config.services.forgejo.settings.server.HTTP_ADDR}:${builtins.toString config.services.forgejo.settings.server.HTTP_PORT}";
|
||||
};
|
||||
|
||||
# Disallow crawling archives to save disk space.
|
||||
# See: https://forgejo.org/docs/latest/admin/search-engines-indexation/
|
||||
locations."/robots.txt" = {
|
||||
return = "200 \"User-agent: *\\nDisallow: /*/*/archive/\\n\"";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
networking.firewall.allowedTCPPorts = [ 80 443 ];
|
||||
networking.firewall.allowedUDPPorts = [ 443 ];
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue