{ http_port 80 https_port 443 log { output stdout level INFO format console } acme_dns acmedns { config { "example.com" { username "" password "" subdomain "" fulldomain "" server_url "https://auth.acme-dns.io" } } } } http://:80 { respond / "Hello World" 200 } # This works example.com { respond / "Hi from Root" 200 } # This not work web.example.com { respond / "Hi from Web" 200 }
我想 web.example.com 也能使用 example.com 的通配证书
1 wenerme OP 正确写法是这样的 ``` *.example.com { tls { dns <provider_name> [<params...>] } @foo host foo.example.com handle @foo { respond "Foo!" } @bar host bar.example.com handle @bar { respond "Bar!" } # Fallback for otherwise unhandled domains handle { abort } } ``` 万万没想到 |
2 daisyfloor 2024-07-05 07:10:08 +08:00 如果我对某个域名还要处理 handle_path 怎么写? 比如 handle_path /xyz/* { reverse_proxy xyz:9527 } |
3 daisyfloor 2024-07-05 08:01:19 +08:00 知道了 直接全部在 handle 里处理,类似这样 handle @bitwarden { encode gzip reverse_proxy /notifications/hub/negotiate nas:7777 reverse_proxy /notifications/hub nas:3012 reverse_proxy nas:7777 } |
4 daisyfloor 2024-07-05 08:11:24 +08:00 也可以 这样 handle @foo { handle_path /api/* { reverse_proxy localhost:8080 } handle { reverse_proxy localhost:9080 } } |