forge: anubis in front
This commit is contained in:
parent
576f2ac47a
commit
3d1634f3cc
1 changed files with 29 additions and 13 deletions
|
|
@ -1,6 +1,8 @@
|
||||||
{ config, ... }:
|
{ config, ... }:
|
||||||
let
|
let
|
||||||
srv = config.services.forgejo.settings.server;
|
srv = config.services.forgejo.settings.server;
|
||||||
|
anubis-domain-socket = "/run/anubis/anubis-main/anubis.sock";
|
||||||
|
anubis-metrics-socket = "/run/anubis/anubis-main/anubis-metrics.sock";
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
security.acme = {
|
security.acme = {
|
||||||
|
|
@ -8,20 +10,34 @@ in
|
||||||
defaults.email = "acme@darkest.space";
|
defaults.email = "acme@darkest.space";
|
||||||
};
|
};
|
||||||
|
|
||||||
services.nginx = {
|
services = {
|
||||||
enable = true;
|
nginx = {
|
||||||
recommendedProxySettings = true;
|
enable = true;
|
||||||
recommendedTlsSettings = true;
|
recommendedProxySettings = true;
|
||||||
recommendedGzipSettings = true;
|
recommendedTlsSettings = true;
|
||||||
recommendedOptimisation = true;
|
recommendedGzipSettings = true;
|
||||||
|
recommendedOptimisation = true;
|
||||||
|
|
||||||
virtualHosts.${srv.DOMAIN} = {
|
virtualHosts.${srv.DOMAIN} = {
|
||||||
enableACME = true;
|
enableACME = true;
|
||||||
forceSSL = true;
|
forceSSL = true;
|
||||||
extraConfig = ''
|
extraConfig = ''
|
||||||
client_max_body_size 512M;
|
client_max_body_size 512M;
|
||||||
'';
|
'';
|
||||||
locations."/".proxyPass = "http://127.0.0.1:${toString srv.HTTP_PORT}";
|
locations = {
|
||||||
|
"/_metrics".proxyPass = "http://unix:" + anubis-metrics-socket + ":/metrics";
|
||||||
|
"/".proxyPass = "http://unix:" + anubis-domain-socket;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
anubis.instances.forge = {
|
||||||
|
enable = true;
|
||||||
|
settings = {
|
||||||
|
BIND = anubis-domain-socket;
|
||||||
|
TARGET = "http://127.0.0.1:${toString srv.HTTP_PORT}";
|
||||||
|
METRICS_BIND = anubis-metrics-socket;
|
||||||
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue