From d5eed5055eb2b50364b024ab8932c7281f39201b Mon Sep 17 00:00:00 2001 From: Alan Orth Date: Mon, 27 Sep 2021 12:15:47 +0300 Subject: [PATCH] roles/nginx: Add support for gitea gitea hosts are basically webservers, but we need to proxy pass. I am setting up gitea itself manually for now. --- roles/nginx/templates/gitea.j2 | 5 +++++ roles/nginx/templates/vhost.conf.j2 | 5 +++++ 2 files changed, 10 insertions(+) create mode 100644 roles/nginx/templates/gitea.j2 diff --git a/roles/nginx/templates/gitea.j2 b/roles/nginx/templates/gitea.j2 new file mode 100644 index 0000000..573307f --- /dev/null +++ b/roles/nginx/templates/gitea.j2 @@ -0,0 +1,5 @@ + + location / { + proxy_pass http://localhost:3000; + } + diff --git a/roles/nginx/templates/vhost.conf.j2 b/roles/nginx/templates/vhost.conf.j2 index 20acdd1..d3845b9 100644 --- a/roles/nginx/templates/vhost.conf.j2 +++ b/roles/nginx/templates/vhost.conf.j2 @@ -7,6 +7,7 @@ {% set enable_hsts = item.enable_hsts | default(False) %} {% set has_wordpress = item.has_wordpress | default(False) %} {% set needs_php = item.needs_php | default(False) %} +{% set has_gitea = item.has_gitea | default(False) %} # http -> https vhost server { @@ -49,6 +50,10 @@ server { {% include 'wordpress.j2' %} {% endif %} + {% if has_gitea == True %} + {% include 'gitea.j2' %} + {% endif %} + error_page 500 502 503 504 /50x.html; location = /50x.html { root /usr/share/nginx/html;