Hello,
I am trying to migrate to traefik 2 but i am geting some problems.
At the moment i am using nginx as reverse proxy and i have this configuration file:
location / {
proxy_pass http://ui;
proxy_redirect off;
proxy_set_header Host $host;
}
location /userAPI {
proxy_pass http://users-management:8080/userAPI;
proxy_redirect off;
proxy_set_header Host $host;
}
location /rest-alquid-alm {
proxy_pass http://rest-alquid-alm:8080/alquid-alm-restapi;
proxy_redirect off;
proxy_set_header Host $host;
}
Here you can see 3 diferent components (containers):
- ui --> this is the user interface (wrote on angular and in nginx container)
- userAPI --> this is my ouwn module of authentication (it give a valid token) wrote on java and in a tomcat container
- rest-alquid-alm --> this is the backend of the app. It comunicate with the userAPI to get the token. wrote on java and in a tomcat container.
If i run my app with nginx proxy all work without problems, but if i run with traefik the back end get the token, enter in the app and exit because sesion expired.
This is my docker-compose.yml with traefik:
version: "3.3"
services:
traefik:
image: "traefik:v2.2"
container_name: "traefik"
command:
- "--log.level=DEBUG"
- "--api.insecure=true"
- "--providers.docker=true"
- "--providers.docker.exposedbydefault=false"
- "--entrypoints.web.address=:80"
ports:
- "80:80"
- "8080:8080"
volumes:
- "/var/run/docker.sock:/var/run/docker.sock:ro"
ui:
image: myaccount/alquid-alm-ui:dev-alquid
container_name: ui
labels:
- traefik.enable=true
- traefik.http.routers.front.rule=PathPrefix(/
)
volumes:
- ./env.js:/usr/share/nginx/html/env.js
rest-alquid-alm:
container_name: rest-alquid-alm
image: myaccount/rest-alquid-alm:dev-alquid
labels:
- traefik.enable=true
- traefik.http.routers.alquidback.rule=PathPrefix(/alquid-alm-restapi/
)
users-management:
image: myaccount/users-management:dev-alquid
container_name: users-management
labels:
- traefik.enable=true
- traefik.http.routers.userManagement-back.rule=PathPrefix(/userAPI/
)
What is happening? and how can i solve it?
Thank you.