2019-06-22 23:58:08 +02:00
|
|
|
{ config, lib, ... }:
|
|
|
|
|
|
|
|
with lib;
|
|
|
|
|
|
|
|
{
|
|
|
|
vHost = if config.services.gitea.enable then {
|
|
|
|
root = "${config.services.gitea.stateDir}/public";
|
|
|
|
extraConfig = ''
|
|
|
|
location / {
|
|
|
|
try_files maintain.html $uri $uri/index.html @node;
|
|
|
|
}
|
|
|
|
|
|
|
|
location @node {
|
|
|
|
client_max_body_size 0;
|
2023-09-10 15:28:26 +02:00
|
|
|
proxy_pass http://${config.services.gitea.settings.server.HTTP_ADDR}:${toString config.services.gitea.settings.server.HTTP_PORT};
|
2019-06-22 23:58:08 +02:00
|
|
|
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
|
|
|
proxy_set_header X-Real-IP $remote_addr;
|
2019-10-06 18:30:47 +02:00
|
|
|
proxy_set_header Host $host;
|
2019-06-22 23:58:08 +02:00
|
|
|
proxy_set_header X-Forwarded-Ssl on;
|
|
|
|
proxy_set_header X-Forwarded-Proto $scheme;
|
|
|
|
proxy_max_temp_file_size 0;
|
|
|
|
proxy_redirect off;
|
|
|
|
proxy_read_timeout 120;
|
|
|
|
}
|
|
|
|
'';
|
|
|
|
} else {};
|
|
|
|
}.vHost
|