From f6d8a3c55f862634eb64c571de70ec631283c91d Mon Sep 17 00:00:00 2001 From: shockrah Date: Sun, 23 Jan 2022 19:16:23 -0800 Subject: [PATCH] + Nginx reverse proxy setup --- docker-host/setup/files/git.leftcoast.local | 8 +++++++ docker-host/setup/handlers/nginx.yml | 6 ++++++ docker-host/setup/tasks/nginx.yml | 24 +++++++++++++++++++++ 3 files changed, 38 insertions(+) create mode 100644 docker-host/setup/files/git.leftcoast.local create mode 100644 docker-host/setup/handlers/nginx.yml diff --git a/docker-host/setup/files/git.leftcoast.local b/docker-host/setup/files/git.leftcoast.local new file mode 100644 index 0000000..bbdf8e0 --- /dev/null +++ b/docker-host/setup/files/git.leftcoast.local @@ -0,0 +1,8 @@ +# This file pertains to the Gitea service which is served under the FQDN: +# git.leftcoast.local +# The default port is listed under /vars/main.yml as 3000 as GITEA_PUB_PORT + +server { + proxy_pass localhost:3000; + server_name git.leftcoast.local; +} diff --git a/docker-host/setup/handlers/nginx.yml b/docker-host/setup/handlers/nginx.yml new file mode 100644 index 0000000..7fc2aa9 --- /dev/null +++ b/docker-host/setup/handlers/nginx.yml @@ -0,0 +1,6 @@ +- name: Restart Nginx + listen: restart-nginx + service: + name: nginx + state: restarted + diff --git a/docker-host/setup/tasks/nginx.yml b/docker-host/setup/tasks/nginx.yml index 9de99fd..f84d725 100644 --- a/docker-host/setup/tasks/nginx.yml +++ b/docker-host/setup/tasks/nginx.yml @@ -34,3 +34,27 @@ recurse: yes owner: "{{STATIC_USER}}" group: "{{STATIC_USER}}" + + - name: Copy Reverse proxy configs + copy: + src: "{{ item.src }}" + dest: /etc/nginx/sites-available/ + loop: + - ../files/git.leftcoast.local + + - name: Enable Sites + file: + src: /etc/nginx/sites-available/{{item}} + dest: /etc/nginx/sites-enabled/{{item}} + state: link + loop: + - git.leftcoast.local + notify: + - restart-nginx + + handlers: + - import_tasks: ../handlers/nginx.yml + + + +