{% set application_id = front_proxy_application_id | default(application_id) %} {% set domain = front_proxy_domain | default(domain) %} server { server_name {{ domain }}; {% include 'roles/sys-svc-proxy/templates/headers/buffers.conf.j2' %} {% if lookup('sso', application_id, 'is_proxy_gated') %} {% include 'roles/web-app-keycloak/templates/sso_proxy/endpoint.conf.j2'%} {% endif %} {% include 'roles/sys-front-inj-all/templates/server.conf.j2'%} {% include 'roles/sys-front-tls/templates/nginx_ssl_header.j2' %} {% if lookup('sso', application_id, 'is_proxy_gated') %} {% set sso_proxy_enabled = true %} {% set webserver_location_extra_configuration %} set $postmarks_needs_sso_handoff 0; if ($cookie_connect_sid = "") { set $postmarks_needs_sso_handoff 1; } if ($http_accept !~* "text/html") { set $postmarks_needs_sso_handoff 0; } if ($uri ~ "^/(admin|login|logout|public|images|assets|static|favicon)") { set $postmarks_needs_sso_handoff 0; } if ($postmarks_needs_sso_handoff = 1) { return 302 /admin; } {% endset %} {% set location = '/' %} {% include 'roles/sys-svc-proxy/templates/location/html.conf.j2' %} {% set webserver_location_extra_configuration = '' %} {% else %} {% set sso_proxy_enabled = false %} {% set webserver_location_extra_configuration = '' %} {% set location = '/' %} {% include 'roles/sys-svc-proxy/templates/location/html.conf.j2' %} {% endif %} {% include 'roles/web-app-prometheus/templates/nginx/locations.conf.j2' %} }