URL redirector with wildcard patterns, QR codes, analytics integration. Sub-millisecond response.
2.5K
High-performance URL redirector with wildcard patterns, analytics integration, and QR code generation.
Battle-tested in production with minimal resource usage and excellent performance.
Designed as a simpler, more accessible alternative to Shlink, YOURLS, and Polr - no database, no complex setup, just a single binary or Docker container.
Docker Hub | GitHub | Website
/* patterns/yourlink/qr endpoints# Using environment variables for inline mappings
docker run -d \
-p 8080:8080 \
-e REDIRECT_MAPPINGS="store=https://shop.example.com;contact=https://example.com/contact" \
funktionslust/flink:latest
Your redirects are ready:
http://localhost:8080/store → https://shop.example.comhttp://localhost:8080/contact → https://example.com/contact# Build from source
go build -o flink .
# Run with inline mappings
./flink -mappings "store=https://shop.example.com;docs=https://docs.example.com" -port 8080
# Use a configuration file
./flink -mappings /etc/flink/redirects.txt
# Disable query parameter forwarding
./flink -mappings redirects.txt -forward-query-params=false
# With Matomo analytics tracking
./flink -mappings redirects.txt -matomo-url https://analytics.example.com -matomo-token your-api-token
# Custom trusted proxy configuration
./flink -mappings redirects.txt -trusted-proxies "10.0.0.0/8,192.168.1.0/24"
Create redirects.txt:
# Marketing campaigns
summer-sale=https://shop.com/promotions/summer
black-friday=https://shop.com/deals/black-friday
# Support links
help=https://docs.example.com
status=https://status.example.com
# Permanent redirects for SEO (using named aliases)
old-product=https://shop.com/products/new-name,permanent
legacy-api=https://api.v2.example.com,status=301
# Wildcard patterns for bulk redirects
blog/*=https://newsite.com/posts/*,permanent
old-docs/*=https://docs.example.com/archive/*
Run with Docker:
docker run -d \
-p 8080:8080 \
-v ./redirects.txt:/app/redirects.txt \
-e REDIRECT_MAPPINGS=/app/redirects.txt \
funktionslust/flink:latest
Load configuration from a web server - perfect for centralized management:
docker run -d \
-p 8080:8080 \
-e REDIRECT_MAPPINGS=https://config.example.com/redirects.txt \
funktionslust/flink:latest
fLINK will fetch the configuration from the URL and refresh it every 10 minutes automatically.
Problem: You need to advertise https://shop.example.com/products/category/summer-collection-2025?utm_source=radio&utm_medium=audio&utm_campaign=summer25 on a radio ad.
Solution: Create a short, memorable redirect:
# redirects.txt
summer=https://shop.example.com/products/category/summer-collection-2025
Now you can:
link.co/summer?utm_source=radio for radio adslink.co/summer?utm_source=billboard for outdoor adslink.co/summer?utm_source=tv for TV commercials# redirects.txt
menu=https://restaurant.com/current-menu.pdf
wifi=https://restaurant.com/wifi-instructions
Generate QR codes automatically:
https://link.restaurant.com/menu/qrhttps://link.restaurant.com/wifi/qrUpdate the destination URLs anytime without reprinting QR codes!
Preserve search rankings with permanent redirects:
# Use status codes or named aliases
old-blog=https://newsite.com/blog,permanent
legacy-api=https://api.v2.example.com,status=301
old-shop=https://newshop.com,301
# Bulk redirect with wildcards
docs/*=https://newdocs.com/archive/*,permanent
blog/*=https://newsite.com/articles/*,301
services:
flink:
image: funktionslust/flink:latest
volumes:
- ./redirects.txt:/app/redirects.txt
environment:
- REDIRECT_MAPPINGS=/app/redirects.txt
- TRUSTED_PROXIES=10.0.0.0/8,172.16.0.0/12,192.168.0.0/16
labels:
- "traefik.enable=true"
- "traefik.http.routers.flink.rule=Host(`link.yourdomain.com`)"
- "traefik.http.routers.flink.tls.certresolver=letsencrypt"
restart: unless-stopped
services:
flink:
image: funktionslust/flink:latest
environment:
- REDIRECT_MAPPINGS=/app/redirects.txt
- MATOMO_URL=https://analytics.example.com
- MATOMO_TOKEN_FILE=/run/secrets/matomo_token
secrets:
- matomo_token
restart: unless-stopped
Analytics Features:
short-code=destination-url[,status=301|302|307|308|permanent|temporary]
permanent for permanent redirects (SEO)temporary for temporary redirectstemporary-strict) or 308 (permanent-strict) to preserve request methodsee-other) to change POST to GETHandle bulk redirects with wildcard patterns:
# Redirect entire directory structures
blog/*=https://newsite.com/articles/*
docs/*=https://documentation.site/*
# API versioning
api/v1/*=https://v1.api.com/*
api/v2/*=https://v2.api.com/*
# Catch-all (lowest priority)
/*=https://default.com/*
Pattern Matching Rules:
*) must be at the end of the pathblog/* → https://new.com/posts/*/blog/hello-world → https://new.com/posts/hello-world| Flag | Description | Default |
|---|---|---|
-mappings | File path, URL, or inline mappings | - |
-port | Server port | 8080 |
-forward-query-params | Forward query parameters to destination | true |
-trusted-proxies | Comma-separated CIDR ranges of trusted proxies | Private networks |
-matomo-url | Matomo analytics URL | - |
-matomo-token | Matomo API token | - |
-help | Show help message | - |
-version | Show version information | - |
| Variable | Description | Default |
|---|---|---|
REDIRECT_MAPPINGS | File path, URL, or inline mappings | - |
PORT | Server port | 8080 |
FORWARD_QUERY_PARAMS | Forward query parameters to destination | true |
TRUSTED_PROXIES | Comma-separated CIDR ranges of trusted proxies | Private networks |
MATOMO_URL | Analytics server URL | - |
MATOMO_TOKEN | Analytics API token | - |
Notes:
_FILE suffix for Docker secrets../, null bytes, and encoded attacksX-Content-Type-Options, X-Frame-OptionsX-Forwarded-* headershttp:// or https:// destinations# Simple health check
curl http://localhost:8080/health
# Check specific redirect
curl -I http://localhost:8080/your-link
All requests are logged with structured format:
[2025-01-15T10:30:45Z] 192.168.1.100 GET /campaign → https://shop.com (301) 1.2ms
[2025-01-15T10:30:46Z] 192.168.1.101 GET /menu/qr → QR:https://link.com/menu (200) 3.5ms
MIT License - Use it freely in your projects!
Built by Funktionslust GmbH
Enterprise software development and consulting.
Content type
Image
Digest
sha256:509d1e02c…
Size
6.6 MB
Last updated
about 1 year ago
docker pull funktionslust/flink