I want to redirect one URL to another URL through traefik.
I am using docker for this configuration and below is my docker-compose.yml file
version: '3'
services:
reverse-proxy:
# The official v2.0 Traefik docker image
image: containous/whoami
container_name: "whoami_cont"
# Enables the web UI and tells Traefik to listen to docker
ports:
# The HTTP port
- 80:80
# The Web UI (enabled by --api.insecure=true)
- 8080:8080
labels:
- traefik.http.middlewares.test-replacepathregex.replacepathregex.regex=^(https?|ftp|file)://[-a-zA-Z0-9+&@#/%?=~_|!:,.;]*[-a-zA-Z0-9+&@#/%=~_|]
- traefik.http.middlewares.test-replacepathregex.replacepathregex.replacement=http://localhost:8081/4
then I am running docker-compose command successfully. Then I am going to hit any URL which matching regex pattern but URL is not redirecting to another URL - http://localhost:8081/4 as per configuration. I am using traefik version 2.0
Please let me know if any configuration is missing.