From 28fc51f72307c44fdbe19de68d7afd4d942c3ee5 Mon Sep 17 00:00:00 2001 From: Ryan Westfall Date: Tue, 20 Oct 2026 10:26:19 -0500 Subject: [PATCH] Keep HeyCatch short links on the public host. A relative redirect from the static vhost was rewritten with the container port, so links like /y landed on hesychia.ai:8082. --- roles/web-static/templates/nginx.conf.j2 | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/roles/web-static/templates/nginx.conf.j2 b/roles/web-static/templates/nginx.conf.j2 index a340b0f..eda7e18 100644 --- a/roles/web-static/templates/nginx.conf.j2 +++ b/roles/web-static/templates/nginx.conf.j2 @@ -58,6 +58,17 @@ server { {%- endif %} {%- endif %} +{% if a.name == 'chat_web_app' and a.env == 'prod' %} + # HeyCatch short links. + # f Facebook, h Threads, i Instagram, l LinkedIn, r Reddit, x X, y YouTube. + # Relative Location: this vhost listens on the container port. An absolute + # redirect would publish that port (hesychia.ai:8082). + location ~ ^/([a-z0-9])/?$ { + absolute_redirect off; + return 302 /?utm_source=heycatch&utm_campaign=$1; + } +{% endif %} + {% if app_catalog[a.name].error_page_404 | default('') %} error_page 404 {{ app_catalog[a.name].error_page_404 }}; -- 2.54.0