Wildcard Subdomain #4823
caf-3
started this conversation in
Feature Requests
Replies: 2 comments 1 reply
-
I achieved this through custom labels: traefik.enable=true
traefik.http.middlewares.gzip.compress=true
traefik.http.middlewares.redirect-to-https.redirectscheme.scheme=https
# HTTP router for subdomains
traefik.http.routers.<unique_router_name_subdomain_http>.entryPoints=http
traefik.http.routers.<unique_router_name_subdomain_http>.middlewares=redirect-to-https
traefik.http.routers.<unique_router_name_subdomain_http>.rule=HostRegexp(`.*\.example\.com`)
traefik.http.routers.<unique_router_name_subdomain_http>.service=<unique_service_name_subdomain>
# HTTP router for root domain
traefik.http.routers.<unique_router_name_root_http>.entryPoints=http
traefik.http.routers.<unique_router_name_root_http>.middlewares=redirect-to-https
traefik.http.routers.<unique_router_name_root_http>.rule=Host(`example.com`) && PathPrefix(`/`)
traefik.http.routers.<unique_router_name_root_http>.service=<unique_service_name_root>
# HTTPS router for subdomains
traefik.http.routers.<unique_router_name_subdomain_https>.entryPoints=https
traefik.http.routers.<unique_router_name_subdomain_https>.middlewares=gzip
traefik.http.routers.<unique_router_name_subdomain_https>.rule=HostRegexp(`.*\.example\.com`)
traefik.http.routers.<unique_router_name_subdomain_https>.service=<unique_service_name_subdomain>
traefik.http.routers.<unique_router_name_subdomain_https>.tls.certresolver=letsencrypt
traefik.http.routers.<unique_router_name_subdomain_https>.tls=true
# HTTPS router for root domain
traefik.http.routers.<unique_router_name_root_https>.entryPoints=https
traefik.http.routers.<unique_router_name_root_https>.middlewares=gzip
traefik.http.routers.<unique_router_name_root_https>.rule=Host(`example.com`) && PathPrefix(`/`)
traefik.http.routers.<unique_router_name_root_https>.service=<unique_service_name_root>
traefik.http.routers.<unique_router_name_root_https>.tls.certresolver=letsencrypt
traefik.http.routers.<unique_router_name_root_https>.tls=true
# Services configuration
traefik.http.services.<unique_service_name_subdomain>.loadbalancer.server.port=3000
traefik.http.services.<unique_service_name_root>.loadbalancer.server.port=3000
# Caddy configuration
caddy_0.encode=zstd gzip
caddy_0.handle_path.0_reverse_proxy={{upstreams 3000}}
caddy_0.handle_path=/*
caddy_0.header=-Server
caddy_0.try_files={path} /index.html /index.php
caddy_0=*.example.com
caddy_1.encode=zstd gzip
caddy_1.handle_path.1_reverse_proxy={{upstreams 3000}}
caddy_1.handle_path=/*
caddy_1.header=-Server
caddy_1.try_files={path} /index.html /index.php
caddy_1=example.com
caddy_ingress_network=coolify |
Beta Was this translation helpful? Give feedback.
0 replies
-
how did you have 4 unique service names ?
|
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Description
When users sign up for an application hosted on Coolify (e.g., at example.com), automatically create and configure a subdomain for them (username.example.com) without manual intervention.
Desired Behavior
Use Cases
Beta Was this translation helpful? Give feedback.
All reactions