Refactor traefik.yml to fix routing rules for chat and bot subdomains

This commit is contained in:
2024-05-30 19:22:36 +08:00
parent 0bb60245dc
commit 63b190ccbd
2 changed files with 23 additions and 15 deletions
+10 -2
View File
@@ -9,8 +9,8 @@ volumes:
meili_data: meili_data:
services: services:
api: librechat_api:
container_name: LibreChat container_name: librechat_api
ports: ports:
- "${PORT}:${PORT}" - "${PORT}:${PORT}"
depends_on: depends_on:
@@ -36,6 +36,14 @@ services:
- type: bind - type: bind
source: ./config/librechat.yaml source: ./config/librechat.yaml
target: /app/librechat.yaml target: /app/librechat.yaml
labels:
- "traefik.enable=true"
- "traefik.http.routers.librechat.entrypoints=web-secure"
- "traefik.http.routers.librechat.rule=Host(`chat.${DOMAINNAME}`) || Host(`bot.${DOMAINNAME}`)"
- "traefik.http.routes.librechat.middlewares=csrf@file"
- "traefik.http.routers.librechat.tls.certresolver=letsencrypt"
- "traefik.http.routers.librechat.service=librechat_app"
- "traefik.http.services.librechat_app.loadbalancer.server.port=${PORT}"
mongodb: mongodb:
container_name: chat-mongodb container_name: chat-mongodb
image: mongo image: mongo
+13 -13
View File
@@ -95,15 +95,15 @@ http:
routers: routers:
chat-router: # chat-router:
entryPoints: # entryPoints:
- web-secure # - web-secure
rule: "Host(`bot.furyhawk.lol`) || Host(`chat.furyhawk.lol`)" # rule: "Host(`bot.furyhawk.lol`) || Host(`chat.furyhawk.lol`)"
middlewares: # middlewares:
- csrf # - csrf
tls: # tls:
certResolver: letsencrypt # certResolver: letsencrypt
service: librechat_app # service: librechat_app
# forum-router: # forum-router:
# entryPoints: # entryPoints:
@@ -258,10 +258,10 @@ http:
# loadBalancer: # loadBalancer:
# servers: # servers:
# - url: http://kestra:8080 # - url: http://kestra:8080
librechat_app: # librechat_app:
loadBalancer: # loadBalancer:
servers: # servers:
- url: http://LibreChat:3080 # - url: http://LibreChat:3080
# neo4j-bolt: # neo4j-bolt:
# loadBalancer: # loadBalancer:
# servers: # servers: