Files
computer-playbook/roles/web-app-nextcloud/templates/proxy.conf.j2
kevinveenbirkenbach 42c7df9ed9 fix(proxy): give the vhost overrides back the concerns they drop
sys-stk-front-proxy prefers a role's own templates/proxy.conf.j2 over a
shared flavour, and an override replaces the flavour whole - including
every cross-cutting include living inside it. Expressing your own
locations should not cost you the MCP policy.

It did. f5272fa85f added that policy to both flavours and to nextcloud,
and the one provider whose native path most needed hiding renders from
its own template, so /mcp kept reaching baserow. The deploy was
failed=0 the whole time: the template produced no line at all, and a
green recap says nothing about a line that never existed. Reading the
rendered vhost is what found it.

Two overrides also lacked the prometheus locations, so nextcloud and
checkmk had no /healthz/live and no per-request metrics. That include
guards itself and emits nothing where prometheus is absent.

The required set is the intersection of the two flavours, so a concern
added to both is demanded of the overrides on the next run without
anyone maintaining a list. Location snippets are excluded, being what an
override exists to replace, and the set is only asked of roles that
actually serve MCP - demanding it of the rest would report noise and
teach the reader to skip the report.

A second rule covers a latent case the intersection cannot: a gated
override needs the oauth2 endpoint and the raised header buffers, both
of which live in one flavour only. All six carry them today, and nothing
made them.
2026-08-29 15:56:13 +02:00

49 lines
1.8 KiB
Django/Jinja

server
{
server_name {{ domain }};
{% include 'roles/sys-front-tls/templates/nginx_ssl_header.j2' %}
{% include 'roles/sys-front-inj-all/templates/server.conf.j2'%}
fastcgi_hide_header X-Powered-By;
add_header X-Robots-Tag "noindex, nofollow";
client_max_body_size {{ webserver_client_max_body_size }};
client_body_buffer_size 400M;
fastcgi_buffers 64 4K;
{% if NEXTCLOUD_HPB_SIGNALING_ENABLED | bool %}
{% set webserver_websocket_location = '^~ ' ~ NEXTCLOUD_HPB_SIGNALING_LOCATION %}
{% set websocket_port = NEXTCLOUD_PORT %}
{% include 'roles/sys-svc-proxy/templates/location/ws.conf.j2' %}
{% endif %}
{% if NEXTCLOUD_WHITEBOARD_ENABLED | bool %}
{% set webserver_websocket_location = '^~ ' ~ NEXTCLOUD_WHITEBOARD_LOCATION %}
{% set websocket_port = NEXTCLOUD_PORT %}
{% include 'roles/sys-svc-proxy/templates/location/ws.conf.j2' %}
{% endif %}
{% include 'roles/sys-svc-proxy/templates/location/html.conf.j2' %}
location ^~ /.well-known {
rewrite ^/\.well-known/host-meta\.json /public.php?service=host-meta-json last;
rewrite ^/\.well-known/host-meta /public.php?service=host-meta last;
rewrite ^/\.well-known/webfinger /public.php?service=webfinger last;
rewrite ^/\.well-known/nodeinfo /public.php?service=nodeinfo last;
location = /.well-known/carddav { return 301 /remote.php/dav/; }
location = /.well-known/caldav { return 301 /remote.php/dav/; }
location = /.well-known/webfinger { return 301 /index.php/.well-known/webfinger; }
location = /.well-known/nodeinfo { return 301 /index.php/.well-known/nodeinfo; }
try_files $uri $uri/ =404;
}
{% include 'roles/web-app-prometheus/templates/nginx/locations.conf.j2' %}
{% include 'roles/sys-svc-proxy/templates/mcp/vhost.conf.j2' %}
}