I have two apps in docker:
Now I have domain.com.
I want to redirect:
I tried to read the documentation and tried but had no success. The container for App A and B are running. The Traefik says to use docker compose as one way but I just want to keep the old container. Do I directly run the Traefik ./traefik --configFile=traefik.toml
which is one of the way with config file.
I am not sure what to add to the config.
If you would like to go ahead with Nginx, I'll suggest you go ahead with jwilder's Nginx Reverse Proxy which will help you do the same thing with Nginx instead of Traefik.
All you need to do is simply run the Nginx reverse proxy container once. After that whenever you spin, say App A all you'll need to do is pass an extra variable in the command like docker run -e VIRTUAL_HOST=appa.domain.com ...
for every container
Have you checked the documentation of Traefik's docker backend?
You can configure the URL at which you expose the apps via a label on the container itself. For instance if you are using docker-compose, you can add something like this:
labels:
traefik.frontend.rule: Host:appa.domain.com
traefik.enable: "true"
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.