diff --git a/roles/caddy/defaults/main.yml b/roles/caddy/defaults/main.yml index ce6508b..f32c03f 100644 --- a/roles/caddy/defaults/main.yml +++ b/roles/caddy/defaults/main.yml @@ -5,3 +5,5 @@ # web root directory website_path: /srv/http + +gitea_domain: "git.{{ domain }}" diff --git a/roles/caddy/templates/Caddyfile.j2 b/roles/caddy/templates/Caddyfile.j2 index b53f622..f54dd27 100644 --- a/roles/caddy/templates/Caddyfile.j2 +++ b/roles/caddy/templates/Caddyfile.j2 @@ -4,3 +4,9 @@ www.{{ domain }} { file_server } {% endif %} + +{% if groups["gitea"] %} +{{ gitea_domain }} { + reverse_proxy {{ groups["gitea"][0] }}:3000 +} +{% endif %}