1 回答

TA貢獻(xiàn)1851條經(jīng)驗(yàn) 獲得超4個(gè)贊
只是發(fā)布我最終為我的設(shè)置所做的事情。Nginx確實(shí)支持 1.3.10+ 版本的 GRPC,但需要大量手動(dòng)工作和 cron 作業(yè)來(lái)自動(dòng)更新證書,并且它缺少操作方法文檔。
簡(jiǎn)而言之,Traefik 允許更簡(jiǎn)單的設(shè)置和非常詳細(xì)的 GRPC 文檔來(lái)開始。另一個(gè)優(yōu)點(diǎn)是它在 docker 本身內(nèi)部運(yùn)行,因此可以輕松地在我的 mac 上測(cè)試我在服務(wù)器上部署的相同版本。它提供了自動(dòng)證書續(xù)訂和 DNS 質(zhì)詢,我可以輕松驗(yàn)證域。
TOML
反向代理端 TLS 終止的示例文件,用于 GRPC 和普通 REST 服務(wù),支持http
(對(duì)于較舊的應(yīng)用程序) &?https
.
defaultEntryPoints = ["http", "https"]
logLevel = "INFO"
[traefikLog]
[accessLog]
? filePath = "/var/log/access.log"
? format = "json"
[entryPoints]
? [entryPoints.http]
? address = ":80"
? [entryPoints.https]
? address = ":443"
? ? [entryPoints.https.tls]
[api]
[file]
[acme]
email = "admin@example.com"
storage = "acme.json"
entryPoint = "https"
acmeLogging = true
? [acme.dnsChallenge]
? ? provider = "gcloud"
? [[acme.domains]]
? ? main = "*.example.com"
? ? sans = ["www.example.com"]
[backends]
? [backends.foo]
? ? [backends.foo.servers.server1]
? ? url = "h2c://127.0.0.1:3000"
? [backends.bar]
? ? [backends.bar.servers.server1]
? ? url = "http://127.0.0.1:3001"
[frontends]
? [frontends.foo]
? backend = "foo"
? ? [frontends.foo.routes.server1]
? ? rule = "Host:foo.example.com"
? passHostHeader = true
? passTLSCert = false
? [frontends.bar]
? backend = "bar"
? ? [frontends.bar.routes.server1]
? ? rule = "Host:bar.example.com"
? passHostHeader = true
? passTLSCert = false
唯一的問(wèn)題是弄清楚提供商 ( dnsChallenge) 的 Google Cloud 設(shè)置,如果是第一次這樣做,很難找到和設(shè)置!
- 1 回答
- 0 關(guān)注
- 244 瀏覽
添加回答
舉報(bào)