← Extract Docs CREWS home

Shortlinks

How CREWS maps long clip URLs on crews.championship.technology to short URLs on www.championship.technology without changing the address bar, plus the nginx directives to paste once in Plesk.

How we built it

Goal: share https://www.championship.technology/2026-WORLDS-PRELIMS.rar while the file still lives at https://crews.championship.technology/clips/2026/WORLDS/PRELIMS.rar. Recipients must keep the short URL in the bar (proxy), not a 302 that reveals the long path.

  1. Deterministic slug — no registry, no per-file Plesk edits. Pattern: /clips/{YEAR}/{NAME}/{file.rar}{YEAR}-{NAME}-{file.rar}. Example: CRW-X.rar2026-WORLDS-CRW-X.rar. Region folder names have no hyphens (WORLDS, USA); filenames may contain hyphens.
  2. CREWS Pythonrar_support.py builds/reverses the slug; server.py serves GET /YEAR-NAME-file.rar from clips/YEAR/NAME/file.rar (byte-range capable). Env: CREWS_SHORTLINK_ORIGIN (default https://www.championship.technology).
  3. Extract UI — link icon next to Copy URL copies the short origin URL instantly (no registration step).
  4. Apex nginx (once) — on championship.technology / www, one regex location proxies matching *.rar shortlinks to 127.0.0.1:8765 (same CREWS process as the subdomain).
Layer Role
Slug math rar_support.shortlink_slug_from_clips_public_path / reverse
Serve short path server._try_serve_clip_shortlink
Copy button Extract → Clips RAR packages (chain icon)
Apex proxy deploy/nginx-championship.technology-shortlinks.conf
Optional /crews UI deploy/nginx-championship.technology-crews.conf

Plesk strips {4} from \d{4} in Additional nginx directives. Always write four digit classes: [0-9][0-9][0-9][0-9].

Nginx — www …/crews UI (optional)

Keeps https://www.championship.technology/crews/… in the bar while proxying to CREWS. Do not set CREWS_PUBLIC_BASE=/crews — the UI auto-detects /crews from the browser path.

location = /crews {
    return 301 /crews/;
}

location /crews/ {
    proxy_pass http://127.0.0.1:8765/;
    proxy_http_version 1.1;
    proxy_set_header Host $host;
    proxy_set_header X-Real-IP $remote_addr;
    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    proxy_set_header X-Forwarded-Proto $scheme;
    proxy_buffering off;
    proxy_request_buffering off;
    proxy_read_timeout 3600s;
    proxy_send_timeout 3600s;
    client_max_body_size 0;
}

Canonical file: deploy/nginx-championship.technology-crews.conf

General form — shortlinks with nginx only

You can map any path on crews.championship.technology to a short path on www.championship.technology using only apex nginx (no CREWS slug code). Prefer proxy when the short URL must stay in the address bar; use redirect only when revealing the long URL is acceptable.

A. One-off exact path (proxy — bar stays short)

Map www.championship.technology/SHORTLINKcrews.championship.technology/xxx/yyy/zzz (same machine, CREWS on 8765):

# Example: /PRELIMS.rar → /clips/2026/WORLDS/PRELIMS.rar on CREWS
location = /PRELIMS.rar {
    proxy_pass http://127.0.0.1:8765/clips/2026/WORLDS/PRELIMS.rar;
    proxy_http_version 1.1;
    proxy_set_header Host crews.championship.technology;
    proxy_set_header X-Real-IP $remote_addr;
    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    proxy_set_header X-Forwarded-Proto $scheme;
    proxy_buffering off;
    proxy_request_buffering off;
    proxy_read_timeout 3600s;
    proxy_send_timeout 3600s;
    client_max_body_size 0;
}

Arbitrary path example (/xxx/yyy/zzz → short /SHORTLINK):

location = /SHORTLINK {
    proxy_pass http://127.0.0.1:8765/xxx/yyy/zzz;
    proxy_http_version 1.1;
    proxy_set_header Host crews.championship.technology;
    proxy_set_header X-Real-IP $remote_addr;
    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    proxy_set_header X-Forwarded-Proto $scheme;
    proxy_buffering off;
    proxy_request_buffering off;
    proxy_read_timeout 3600s;
    proxy_send_timeout 3600s;
    client_max_body_size 0;
}

B. One-off redirect (bar becomes long URL)

location = /SHORTLINK {
    return 302 https://crews.championship.technology/xxx/yyy/zzz;
}

C. Many mappings via nginx map

Better than dozens of location = blocks when the set grows. Put the map in a file included from the http context (or Plesk custom template) — Additional directives alone may not allow top-level map depending on Plesk version.

# http { … } context (not always available in Plesk Additional directives)
map $uri $crews_short_target {
    default "";
    /PRELIMS.rar   /clips/2026/WORLDS/PRELIMS.rar;
    /SHORTLINK     /xxx/yyy/zzz;
    /docs-stuck    /docs/extract-stuck-at-100.html;
}

# server / Additional directives:
location / {
    if ($crews_short_target = "") { return 404; }
    proxy_pass http://127.0.0.1:8765$crews_short_target;
    proxy_http_version 1.1;
    proxy_set_header Host crews.championship.technology;
    proxy_set_header X-Real-IP $remote_addr;
    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    proxy_set_header X-Forwarded-Proto $scheme;
    proxy_buffering off;
    client_max_body_size 0;
}

A bare location / that proxies everything will break the main www site. Scope shortlinks to exact paths, a prefix (e.g. /go/), or a regex that only matches your shortlink shape.

D. Prefixed shortlinks (safest for mixed www content)

Keep marketing pages on /; put shareable shorts under /s/:

# www.championship.technology/s/PRELIMS.rar
#   → crews …/clips/2026/WORLDS/PRELIMS.rar
location = /s/PRELIMS.rar {
    proxy_pass http://127.0.0.1:8765/clips/2026/WORLDS/PRELIMS.rar;
    proxy_http_version 1.1;
    proxy_set_header Host crews.championship.technology;
    proxy_set_header X-Real-IP $remote_addr;
    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    proxy_set_header X-Forwarded-Proto $scheme;
    proxy_buffering off;
    proxy_request_buffering off;
    proxy_read_timeout 3600s;
    proxy_send_timeout 3600s;
    client_max_body_size 0;
}

Checklist

Operator — create a clip shortlink

  1. Open Extract → Clips RAR packages.
  2. Select a package under clips/YEAR/NAME/.
  3. Click the chain / short link icon (next to Copy URL).
  4. Share the copied https://www.championship.technology/YEAR-NAME-file.rar.

Root-level or extra-folder packages (not under clips/YEAR/NAME/) cannot use this deterministic pattern; use a general nginx-only mapping (section above) if needed.