Hi,
I have a domain like "nextcloud.example.com". It is pointing to my Nextcloud server.
This Nextcloud server is running on docker and managed by traefik and is working fine using SSL certs and is on "Nextcloud.local.example.com"
How do I forward "nextcloud.example.com" to "nextcloud.local.fahadusman.com" when it hits my traefik VM?
Cheers
When both services are in Docker, you can use configuration discovery, like simple Traefik example.
If you explicitly want to create a Traefik router proxying/forwarding requests to another domain, you need to use a dynamic config file, like simple Traefik forward example.
thank you for reply. From the Internet the traffic hits to my traefik VM using url: nextcloud.example.com and that needs to be forwarded to nextcloud.local.example.com which is managed by traefik but I am getting 404 page not found...
Here is what I did:
http:
#region routers
routers:
nextcloud-forward:
entryPoints:
- "https"
rule: Host(`nextcloud.example.com`)
middlewares:
- nextcloud-addHost
service: nextcloud-forward
services:
nextcloud-forward:
loadBalancer:
servers:
- url: https://nextcloud.local.example.com
middlewares:
addHost:
headers:
customRequestHeaders:
Host: https://nextcloud.local.example.com
You have 2 Traefik instances running?
If the forwarded request should have the host header of the forwarded domain, not from the original request, then you can try to set passHostHeader: false
(doc):
## Dynamic configuration
http:
services:
Service01:
loadBalancer:
passHostHeader: false
Hi thanks again. Here is the complete end to end scenario what I am trying to achieve: