server {
  server_name {{ domain }};

  {% include 'roles/sys-svc-letsencrypt/templates/ssl_header.j2' %}
  
  {% include 'roles/sys-front-inj-all/templates/server.conf.j2'%}

  {% include 'roles/sys-svc-proxy/templates/headers/content_security_policy.conf.j2' %}

  {% include 'roles/sys-svc-proxy/templates/headers/access_control_allow.conf.j2' %}

  {# Normal HTTP routes (discovery, browser, assets) – no Lua injection #}
  {% set proxy_lua_enabled = false %}
  {% set location = "/" %}
  {% include 'roles/sys-svc-proxy/templates/location/html.conf.j2' %}

  {# Optional explicit fast path for discovery #}
  {% set location = "= " ~ container_healthcheck %}
  {% include 'roles/sys-svc-proxy/templates/location/html.conf.j2' %}

  {# WebSocket handling for Collabora #}
  {% set webserver_websocket_location = '^~ /cool/' %}
  {% set webserver_websocket_port = http_port %}
  {% include 'roles/sys-svc-proxy/templates/location/ws.conf.j2' %}
}
