This commit is contained in:
dzj 2023-11-05 20:55:30 +08:00
parent cff2fc461f
commit 5eba3bd9a6
3 changed files with 36 additions and 18 deletions

View File

@ -34,14 +34,20 @@ services:
# 定义SSLentrypoints=web-ssl接受https请求路由和服务要重新定义一次
- "traefik.http.routers.demo01-jib-ssl.tls=true"
- "traefik.http.routers.demo01-jib-ssl.entrypoints=web-ssl"
- "traefik.http.routers.demo01-jib-ssl.rule=PathPrefix(`/demo01`)"
- "traefik.http.routers.demo01-jib-ssl.rule=Host(`www.dingzhaojun.top`) && PathPrefix(`/demo01`)"
- "traefik.http.routers.demo01-jib-ssl.service=demo01"
# HTTP 协议自动跳转 HTTPS
#- "traefik.http.middlewares.to-https.redirectscheme.scheme=https"
#- "traefik.http.middlewares.to-https.redirectscheme.permanent=true"
#- "traefik.http.middlewares.to-https.redirectscheme.port=7443"
#- "traefik.http.routers.demo01-jib.middlewares=to-https"
# 定义URL重定向中间件switch-domain将http://localhost转换为https://www.dingzhaojun.top
- "traefik.http.middlewares.switch-domain.redirectregex.regex=^http://localhost(.*)"
- "traefik.http.middlewares.switch-domain.redirectregex.replacement=http://www.dingzhaojun.top$$1"
# 定义URL中的scheme、port重定向中间件to-https将http转换为https8081转换为7443但不转换IP地址部分
- "traefik.http.middlewares.to-https.redirectscheme.scheme=https"
- "traefik.http.middlewares.to-https.redirectscheme.permanent=true"
- "traefik.http.middlewares.to-https.redirectscheme.port=7443"
# 设置路由demo01-jib使用的中间件
- "traefik.http.routers.demo01-jib.middlewares=switch-domain"
networks:
y9-share-net:

View File

@ -34,15 +34,21 @@ services:
# 定义SSLentrypoints=web-ssl接受https请求路由和服务要重新定义一次
- "traefik.http.routers.demo01-jvm-ssl.tls=true"
- "traefik.http.routers.demo01-jvm-ssl.entrypoints=web-ssl"
- "traefik.http.routers.demo01-jvm-ssl.rule=PathPrefix(`/demo01`)"
- "traefik.http.routers.demo01-jvm-ssl.rule=Host(`www.dingzhaojun.top`) && PathPrefix(`/demo01`)"
- "traefik.http.routers.demo01-jvm-ssl.service=demo01"
# HTTP 协议自动跳转 HTTPS
#- "traefik.http.middlewares.to-https.redirectscheme.scheme=https"
#- "traefik.http.middlewares.to-https.redirectscheme.permanent=true"
#- "traefik.http.middlewares.to-https.redirectscheme.port=7443"
#- "traefik.http.routers.demo01-jib.middlewares=to-https"
# 定义URL重定向中间件switch-domain将http://localhost转换为https://www.dingzhaojun.top
- "traefik.http.middlewares.switch-domain.redirectregex.regex=^http://localhost(.*)"
- "traefik.http.middlewares.switch-domain.redirectregex.replacement=http://www.dingzhaojun.top$$1"
# 定义URL中的scheme、port重定向中间件to-https将http转换为https8081转换为7443但不转换IP地址部分
- "traefik.http.middlewares.to-https.redirectscheme.scheme=https"
- "traefik.http.middlewares.to-https.redirectscheme.permanent=true"
- "traefik.http.middlewares.to-https.redirectscheme.port=7443"
# 设置路由demo01-jib使用的中间件
- "traefik.http.routers.demo01-jib.middlewares=switch-domain"
networks:
y9-share-net:

View File

@ -34,14 +34,20 @@ services:
# 定义SSLentrypoints=web-ssl接受https请求路由和服务要重新定义一次
- "traefik.http.routers.demo01-native-ssl.tls=true"
- "traefik.http.routers.demo01-native-ssl.entrypoints=web-ssl"
- "traefik.http.routers.demo01-native-ssl.rule=PathPrefix(`/demo01`)"
- "traefik.http.routers.demo01-native-ssl.rule=Host(`www.dingzhaojun.top`) && PathPrefix(`/demo01`)"
- "traefik.http.routers.demo01-native-ssl.service=demo01"
# HTTP 协议自动跳转 HTTPS
#- "traefik.http.middlewares.to-https.redirectscheme.scheme=https"
#- "traefik.http.middlewares.to-https.redirectscheme.permanent=true"
#- "traefik.http.middlewares.to-https.redirectscheme.port=7443"
#- "traefik.http.routers.demo01-jib.middlewares=to-https"
# 定义URL重定向中间件switch-domain将http://localhost转换为https://www.dingzhaojun.top
- "traefik.http.middlewares.switch-domain.redirectregex.regex=^http://localhost(.*)"
- "traefik.http.middlewares.switch-domain.redirectregex.replacement=http://www.dingzhaojun.top$${1}"
# 定义URL中的scheme、port重定向中间件to-https将http转换为https8081转换为7443但不转换IP地址部分
- "traefik.http.middlewares.to-https.redirectscheme.scheme=https"
- "traefik.http.middlewares.to-https.redirectscheme.permanent=true"
- "traefik.http.middlewares.to-https.redirectscheme.port=7443"
# 设置路由demo01-jib使用的中间件
- "traefik.http.routers.demo01-jib.middlewares=switch-domain"
networks:
y9-share-net: