compose
This commit is contained in:
parent
5eba3bd9a6
commit
21d10e8cf4
|
@ -38,16 +38,17 @@ services:
|
|||
- "traefik.http.routers.demo01-jib-ssl.service=demo01"
|
||||
|
||||
# 定义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"
|
||||
- "traefik.http.middlewares.switch-domain.redirectregex.regex=^http://localhost:8081/demo01(.*)"
|
||||
- "traefik.http.middlewares.switch-domain.redirectregex.replacement=https://www.dingzhaojun.top:7443/demo01$${1}"
|
||||
|
||||
# 定义URL中的scheme、port重定向中间件to-https,将http转换为https,8081转换为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"
|
||||
# 设置路由demo01-jib使用的中间件,switch-domain或者to-https二选一
|
||||
# 也可以在compose-traefik.yml设置http跳转https,这样就不用在应用的docker里逐一设置了
|
||||
#- "traefik.http.routers.demo01-jib.middlewares=switch-domain"
|
||||
|
||||
networks:
|
||||
y9-share-net:
|
||||
|
|
|
@ -39,16 +39,17 @@ services:
|
|||
|
||||
|
||||
# 定义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"
|
||||
- "traefik.http.middlewares.switch-domain.redirectregex.regex=^http://localhost:8081/demo01(.*)"
|
||||
- "traefik.http.middlewares.switch-domain.redirectregex.replacement=https://www.dingzhaojun.top:7443/demo01$${1}"
|
||||
|
||||
# 定义URL中的scheme、port重定向中间件to-https,将http转换为https,8081转换为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"
|
||||
# 设置路由demo01-jib使用的中间件,switch-domain或者to-https二选一
|
||||
# 也可以在compose-traefik.yml设置http跳转https,这样就不用在应用的docker里逐一设置了
|
||||
#- "traefik.http.routers.demo01-jib.middlewares=switch-domain"
|
||||
|
||||
networks:
|
||||
y9-share-net:
|
||||
|
|
|
@ -38,16 +38,17 @@ services:
|
|||
- "traefik.http.routers.demo01-native-ssl.service=demo01"
|
||||
|
||||
# 定义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}"
|
||||
- "traefik.http.middlewares.switch-domain.redirectregex.regex=^http://localhost:8081/demo01(.*)"
|
||||
- "traefik.http.middlewares.switch-domain.redirectregex.replacement=https://www.dingzhaojun.top:7443/demo01$${1}"
|
||||
|
||||
# 定义URL中的scheme、port重定向中间件to-https,将http转换为https,8081转换为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"
|
||||
# 设置路由demo01-jib使用的中间件,switch-domain或者to-https二选一
|
||||
# 也可以在compose-traefik.yml设置http跳转https,这样就不用在应用的docker里逐一设置了
|
||||
#- "traefik.http.routers.demo01-jib.middlewares=switch-domain"
|
||||
|
||||
networks:
|
||||
y9-share-net:
|
||||
|
|
|
@ -8,11 +8,11 @@ services:
|
|||
restart: unless-stopped
|
||||
extra_hosts:
|
||||
- "host.docker.internal:host-gateway"
|
||||
- "www.dingzhaojun.top:127.0.0.1"
|
||||
#- "www.dingzhaojun.top:127.0.0.1"
|
||||
networks:
|
||||
y9-share-net: {}
|
||||
mynet:
|
||||
ipv4_address: '192.168.31.250'
|
||||
#mynet:
|
||||
# ipv4_address: '192.168.31.250'
|
||||
ports:
|
||||
# Expose 8081
|
||||
- "8081:8081"
|
||||
|
@ -41,6 +41,8 @@ services:
|
|||
- "--entrypoints.web.address=:8081"
|
||||
- "--entrypoints.web-ssl.address=:7443"
|
||||
- "--entrypoints.traefik.address=:8080"
|
||||
- "--entrypoints.web.http.redirections.entrypoint.to=web-ssl"
|
||||
- "--entrypoints.web.http.redirections.entrypoint.scheme=https"
|
||||
- "--providers.docker=true"
|
||||
- "--providers.docker.watch=true"
|
||||
- "--providers.docker.exposedbydefault=false"
|
||||
|
|
Loading…
Reference in New Issue