diff --git a/playbook.yml b/playbook.yml index 725594f..3ccc979 100644 --- a/playbook.yml +++ b/playbook.yml @@ -3,3 +3,4 @@ roles: - nginx - jellyfin + - oauth2proxy diff --git a/roles/oauth2proxy/tasks/main.yml b/roles/oauth2proxy/tasks/main.yml index b0a4cfc..6a1cbcf 100644 --- a/roles/oauth2proxy/tasks/main.yml +++ b/roles/oauth2proxy/tasks/main.yml @@ -18,9 +18,9 @@ networks: - name: bridge - name: nginx-internal - command: '/bin/oauth2-proxy --config=/etc/oauth-proxy.cfg' + command: '/bin/oauth2-proxy --config=/etc/oauth2-proxy.cfg' volumes: - - "{{ data_folder }}/oauth2-proxy/oauth-proxy.cfg:/etc/oauth-proxy.cfg" + - "{{ data_folder }}/oauth2-proxy/oauth2-proxy.cfg:/etc/oauth2-proxy.cfg" ports: - "4180:4180" - name: copy oauth2-proxy nginx config diff --git a/roles/oauth2proxy/templates/oauth2-proxy.conf.j2 b/roles/oauth2proxy/templates/oauth2-proxy.conf.j2 index e5fc2df..df59f9f 100644 --- a/roles/oauth2proxy/templates/oauth2-proxy.conf.j2 +++ b/roles/oauth2proxy/templates/oauth2-proxy.conf.j2 @@ -1,10 +1,11 @@ server { listen 443 default ssl; - server_name auth.dev.local; + server_name "auth.{{ base_domain }}"; add_header Strict-Transport-Security max-age=2592000; + set $oauth2proxy oauth2-proxy; location / { - proxy_pass http://127.0.0.1:4180; + proxy_pass http://$oauth2proxy:4180; proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Scheme $scheme;