34 lines
889 B
YAML
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

http:
routers:
main-https:
rule: &host_rule "Host(`example.com`) || Host(`www.example.com`)"
entryPoints:
- websecure
service: main-service
# 如果需要使用自动申请SSL证书自动续期等功能请取消注释以下内容
# tls:
# certResolver: myresolver
main-http-redirect:
rule: *host_rule
entryPoints:
- web
middlewares:
- redirect-to-https
service: noop
services:
main-service:
loadBalancer:
servers:
- url: "http://100.100.100.100:3000" # 这里填写你的后端服务地址(上游服务)
noop:
loadBalancer:
servers:
- url: "http://127.0.0.1:65535" # 占位用无实际后端仅用于HTTP跳转
middlewares:
redirect-to-https:
redirectScheme:
scheme: https
permanent: true