36 lines
1.2 KiB
Plaintext
Raw Normal View History

2020-12-24 14:27:31 +01:00
server
{
server_name {{domain}};
2025-02-19 13:46:45 +01:00
{% if applications | get_oauth2_enabled(application_id) %}
2025-02-19 03:58:21 +01:00
{% include 'roles/docker-oauth2-proxy/templates/endpoint.conf.j2'%}
{% endif %}
{% include 'roles/nginx-modifier-all/templates/global.includes.conf.j2'%}
2025-02-07 13:39:46 +01:00
{% if nginx_docker_reverse_proxy_extra_configuration is defined %}
{# Additional Domain Specific Configuration #}
{{nginx_docker_reverse_proxy_extra_configuration}}
2020-12-24 14:27:31 +01:00
{% endif %}
2023-09-02 13:13:28 +02:00
{% include 'roles/letsencrypt/templates/ssl_header.j2' %}
2020-12-24 14:27:31 +01:00
2025-02-19 13:46:45 +01:00
{% if applications | get_oauth2_enabled(application_id) %}
{% if applications[application_id].oauth2_proxy.location is defined %}
{# Exposed and Unprotected Location #}
{% include 'proxy_pass.conf.j2' %}
{% set oauth2_proxy_enabled = true %}
{% set location = applications[application_id].oauth2_proxy.location %}
{# Gated Location by OAuth2 Proxy #}
{% include 'proxy_pass.conf.j2' %}
{% else %}
{% set oauth2_proxy_enabled = true %}
{# Protected Domain by OAuth2 Proxy #}
{% include 'proxy_pass.conf.j2'%}
{% endif %}
{% else %}
{# Exposed Domain - Not protected by OAuth2 Proxy #}
{% include 'proxy_pass.conf.j2' %}
{% endif %}
2020-12-24 14:27:31 +01:00
}