Hi!
Sorry I'm back again with Path based routing doubt , you told me that to use PathPrefix there should be a route specified to that particular path. So I took an sample container like grafana and if I goto localhost:6061 it redirects me to localhost:6061/login so there is a route specified for login, So I tried setting the rule like this Host(localhost) && PathPrefix(/login)
which needs to redirect me to login page right? but I'm getting 404 why is that? and I recently read an article where he used PathPrefix to multiple paths and published his app without any routes configured to that path, can you explain why it is working for him and not for us?
the below is my docker-compose.yml:
The article is using self-developed source code that simply respond with "hello" to any request, path doesn't matter. This is not how real world apps behave
This is the full URL used to access Grafana from a web browser. This is important if you use Google or GitHub OAuth authentication (for the callback URL to be correct).
NOTE
This setting is also important if you have a reverse proxy in front of Grafana that exposes it through a subpath. In that case add the subpath to the end of this URL setting.
But that does not mean you can run other GUI web apps with a path.
I have a certificate from AWS Certificate manager and my domain is *.abc.xyz.com and I dont know about lets encrypt and acme lables and I want to know what are the correct labels that I have to use, Can you please guide me?
Load certs in dynamic config file (doc), load the file in static config with providers.file. Enable TLS globally on websecure entrypoint or individually on router (yaml config .tls={} or labels .tls=true).
See simple Traefik example for minimum config. Traefik will use the domain from Host() to find a matching loaded cert.
Can you explain why do we need certificate needs to be in the config file for dynamic subdomain routing, I just want to know how this is working.
I have a amazon certificate for my domain *.abc.xyz.com and I will attach this certificate to my amazon load balancer , so if I route traffic from abc1.abc.xyz.com which comes to my server is http (because the ssl termination happens at loadbalancer and internal traffic that comes is http) and why do I have to give the entrypoint as https in traefik? and I just want to how dynamic subdomain routing works in traefik and if I have attached my certificate to my load balancer will this( abc1.abc.xyz.com) directly route to my server?
If you terminate the TLS connection already at an external load balancer (and forward all requests with plain http), then you don't need any TLS in Traefik.
whoami:
image: traefik/whoami:v1.10
networks:
- proxy
labels:
- traefik.enable=true
- traefik.http.routers.mywhoami.rule=Host(`whoami.example.com`)
# next line is the port the application is listening to inside the container
- traefik.http.services.mywhoami.loadbalancer.server.port=80
(We have load balancer on TCP level, they don't have any TLS certs, so the external provider can't look into our traffic, we terminate TLS only on our machines with Traefik.)
Sorry I didn't attached the certificate to loadbalancer thats why I was getting this error, So everything is solved now, Now I'm able to do the dynamical subdomain routing.
Thanks @bluepuma77 for solving every basic doubt about the traefik, I hope our discussion might be helpful for many beginners who are starting to work with traefik.