From 333d583ccde4e3b82111083b8a6a433b85c23b22 Mon Sep 17 00:00:00 2001 From: Ryan Westfall Date: Tue, 20 Oct 2026 08:55:10 -0700 Subject: [PATCH] Keep HeyCatch short links on the public host (#46) ## Summary - `master` already contains the 124 public-page nginx (crawler files, exact HTML paths, 404 page, security headers) and the shortlink redirect that published port 8082. - This branch merges that `master` and keeps one change: `absolute_redirect off` on `/f`, `/h`, `/i`, `/l`, `/r`, `/x`, and `/y`, including an optional trailing slash. - One deploy after merge. No separate 124 deploy. `chat_web_app` is unchanged. ## Test plan - [ ] Merge, then apply the web-static role on a prod host. - [ ] `curl -sI https://hesychia.ai/y` returns `302` and `Location: /?utm_source=heycatch&utm_campaign=y` (no `:8082`). - [ ] Same check for `/f`, `/h`, `/i`, `/l`, `/r`, and `/x`. - [ ] `https://hesychia.ai/robots.txt` still returns the crawler file, not the app shell. Reviewed-on: https://git.aimloperations.com/ai_ml_operations/server-infra/pulls/46 --- roles/web-static/templates/nginx.conf.j2 | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/roles/web-static/templates/nginx.conf.j2 b/roles/web-static/templates/nginx.conf.j2 index 771bb53..25142f6 100644 --- a/roles/web-static/templates/nginx.conf.j2 +++ b/roles/web-static/templates/nginx.conf.j2 @@ -95,8 +95,12 @@ server { {% endif %} {% if a.name == 'chat_web_app' and a.env == 'prod' %} - # HeyCatch short links. Unknown paths 404, so the SDK never sees /x. - location ~ ^/([a-z0-9])$ { + # 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 %}