Skip to content

Commit b6b6bd3

Browse files
fix: Update Traefik routing rules for API and client domains
1 parent a53fcac commit b6b6bd3

File tree

1 file changed

+11
-4
lines changed

1 file changed

+11
-4
lines changed

docker-compose.prod.yml

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -70,11 +70,18 @@ services:
7070
retries: 3
7171
start_period: 30s
7272
labels:
73-
- "traefik.enable=true"
74-
- "traefik.http.routers.gateway.rule=Host(`${SERVER_HOST}`)"
73+
# Route 1: API direct domain (api........io)
74+
- "traefik.http.routers.gateway-api.rule=Host(`${SERVER_HOST}`)"
75+
- "traefik.http.routers.gateway-api.entrypoints=websecure"
76+
- "traefik.http.routers.gateway-api.tls.certresolver=letsencrypt"
77+
- "traefik.http.routers.gateway-api.service=gateway"
78+
# Route 2: API on the client domain
79+
- "traefik.http.routers.gateway-client.rule=Host(`${CLIENT_HOST}`) && PathPrefix(`/api`)"
80+
- "traefik.http.routers.gateway-client.entrypoints=websecure"
81+
- "traefik.http.routers.gateway-client.tls.certresolver=letsencrypt"
82+
- "traefik.http.routers.gateway-client.service=gateway"
83+
# Service config:
7584
- "traefik.http.services.gateway.loadbalancer.server.port=${SERVER_PORT_GATEWAY}"
76-
- "traefik.http.routers.gateway.entrypoints=websecure"
77-
- "traefik.http.routers.gateway.tls.certresolver=letsencrypt"
7885
networks:
7986
- app-network
8087
user-service:

0 commit comments

Comments
 (0)