-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Bug]: Wildcard certificate not working #4360
Comments
@geovanygameros that syntax for regexp is for version 2 of traefik for v3, you can replace with either: HostRegexp(`.+`) or HostRegexp(`^.+\.domain\.com$`) |
Hey @djsisson, thanks for the answer. I updated my app's container labels with:
also with:
And restarted the app and proxy, but I still have the same issue. Also, I'm doing all these updates on the Coolify UI. I don't know if this has any influence |
@geovanygameros can you paste your proxy logs: docxker logs coolify-proxy |
@djsisson I don't see any log I noticed that I have both HTTP and DNS challenges. Could that have something to do?
|
I finally managed to make it work with the following app config 🚀 traefik.http.routers.my-app-3-router-https.rule=HostRegexp(`^.+\.mydomain\.com$`)
traefik.http.routers.my-app-3-router-https.priority=0
traefik.http.routers.my-app-3-router-https.entryPoints=https
traefik.http.routers.my-app-3-router-https.tls=true
traefik.http.routers.my-app-3-router-https.tls.certresolver=letsencrypt
traefik.http.routers.my-app-3-router-https.middlewares=gzip
traefik.http.routers.my-app-3-router-https.service=my-app-3-service
# HTTP Router (for redirecting to HTTPS)
traefik.http.routers.my-app-3-router-http.rule=HostRegexp(`^.+\.mydomain\.com$`)
traefik.http.routers.my-app-3-router-http.priority=0
traefik.http.routers.my-app-3-router-http.entryPoints=http
traefik.http.routers.my-app-3-router-http.middlewares=redirect-to-https
# Define HTTPS Middleware (Compression)
traefik.http.middlewares.gzip.compress=true
# Define HTTP to HTTPS Redirection Middleware
traefik.http.middlewares.redirect-to-https.redirectscheme.scheme=https
# Service Definition
traefik.http.services.my-app-3-service.loadbalancer.server.port=3000
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=://
caddy_ingress_network=coolify I think the key was to use different router names for HTTP and HTTPS to avoid duplicate definitions |
Error Message and Logs
I've been following this documentation to set up a wildcard domain for one application with no success.
What I want to achieve is the following setup for a SaaS application:
I have several projects with a defined domain and they are working fine. However, I want all the rest subdomains to be sent to App 3
Steps to Reproduce
I set up a wildcard A DNS record in Cloudflare pointing to my server's IP address (
*.mydomain.com
)Based on your documentation, I ended up with a proxy file like this:
Then in my application's container labels, I'm following the "SaaS" instructions. So I have something like this:
Then after restarting the proxy and my app, I get the following error when I go to any subdomain. E.g.
customer1.mydomain.com
(for the subdomains that are explicitly defined like "App 1" "App 2", they work fine)
Am I missing something?
Example Repository URL
No response
Coolify Version
v4.0.0-beta.370
Are you using Coolify Cloud?
No (self-hosted)
Operating System and Version (self-hosted)
Ubuntu 24.04.1 LTS
Additional Information
I saw these similar discussions but none of them have a clear answer:
The text was updated successfully, but these errors were encountered: