增加dashboard登录认证功能
This commit is contained in:
parent
009bd2e76b
commit
c904c1a661
6
conf.d/auth.yml
Normal file
6
conf.d/auth.yml
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
http:
|
||||||
|
middlewares:
|
||||||
|
auth:
|
||||||
|
basicAuth:
|
||||||
|
users:
|
||||||
|
- "admin:$2y$05$2J01B9jv7j6cuQUlX1ySHuM/aLQEeCwLskVJYu1rnH5yta2ltox5i"
|
||||||
9
conf.d/dashboard.yml
Normal file
9
conf.d/dashboard.yml
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
http:
|
||||||
|
routers:
|
||||||
|
traefik-dashboard:
|
||||||
|
rule: "Host(`192.168.2.200`) || Host(`localhost`)"
|
||||||
|
entryPoints:
|
||||||
|
- traefik
|
||||||
|
service: api@internal
|
||||||
|
middlewares:
|
||||||
|
- auth
|
||||||
@ -1,12 +1,13 @@
|
|||||||
http:
|
http:
|
||||||
routers:
|
routers:
|
||||||
main-https:
|
main-https:
|
||||||
rule: &host_rule "Host(`purearthsupplies.com`) || Host(`www.purearthsupplies.com`)"
|
rule: &host_rule "Host(`example.com`) || Host(`www.example.com`)"
|
||||||
entryPoints:
|
entryPoints:
|
||||||
- websecure
|
- websecure
|
||||||
service: main-service
|
service: main-service
|
||||||
tls:
|
# 如果需要使用自动申请SSL证书,自动续期等功能,请取消注释以下内容
|
||||||
certResolver: myresolver
|
# tls:
|
||||||
|
# certResolver: myresolver
|
||||||
|
|
||||||
main-http-redirect:
|
main-http-redirect:
|
||||||
rule: *host_rule
|
rule: *host_rule
|
||||||
@ -20,7 +21,7 @@ http:
|
|||||||
main-service:
|
main-service:
|
||||||
loadBalancer:
|
loadBalancer:
|
||||||
servers:
|
servers:
|
||||||
- url: "http://107.174.127.105:3000"
|
- url: "http://100.100.100.100:3000" # 这里填写你的后端服务地址(上游服务)
|
||||||
noop:
|
noop:
|
||||||
loadBalancer:
|
loadBalancer:
|
||||||
servers:
|
servers:
|
||||||
@ -4,8 +4,6 @@ services:
|
|||||||
image: traefik:v3.4
|
image: traefik:v3.4
|
||||||
container_name: traefik
|
container_name: traefik
|
||||||
restart: always
|
restart: always
|
||||||
# Enables the web UI and tells Traefik to listen to docker
|
|
||||||
command: --api.insecure=true --providers.docker
|
|
||||||
ports:
|
ports:
|
||||||
# The HTTP port
|
# The HTTP port
|
||||||
- "80:80"
|
- "80:80"
|
||||||
|
|||||||
@ -3,10 +3,12 @@ entryPoints:
|
|||||||
address: ":80"
|
address: ":80"
|
||||||
websecure:
|
websecure:
|
||||||
address: ":443"
|
address: ":443"
|
||||||
|
traefik:
|
||||||
|
address: ":8080"
|
||||||
|
|
||||||
api:
|
api:
|
||||||
dashboard: true
|
dashboard: true
|
||||||
insecure: true # 生产环境建议关闭
|
insecure: false # 生产环境建议关闭
|
||||||
|
|
||||||
providers:
|
providers:
|
||||||
docker:
|
docker:
|
||||||
@ -21,4 +23,4 @@ certificatesResolvers:
|
|||||||
email: support@jingrow.com
|
email: support@jingrow.com
|
||||||
storage: acme.json
|
storage: acme.json
|
||||||
httpChallenge:
|
httpChallenge:
|
||||||
entryPoint: web
|
entryPoint: web
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user