首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >使用码头的本地主机上的云彩

使用码头的本地主机上的云彩
EN

Stack Overflow用户
提问于 2022-08-10 17:27:13
回答 1查看 502关注 0票数 -1

我对隧道和cloudflare非常陌生。我很难公开Jenkins,使用cloudflare在localhost:8080上运行,这样我就可以为github创建一个webhook了。因此,我使用cloudflare创建了一个隧道,它运行在一个码头容器中。

为了创建隧道,我必须使用cloudflare零信任仪表板,在这里我提到了我的localhost url应该通过隧道公开。出于某种原因,每当我试图访问我使用浏览器创建的公共主机名时,我都会得到error 502 bad gateway。然而,每当我试图隧道的任何其他公共网址,不是本地主机,我被引导到正确的网站。

每当我尝试访问公共主机名时,这些都是容器日志。

代码语言:javascript
复制
2022-08-10T17:00:47Z INF Starting tunnel tunnelID=22f5be5d-f85d-436e-9bc6-a7e5dc4e4f35
2022-08-10T17:00:47Z INF Cannot determine default configuration path. No file [config.yml config.yaml] in [~/.cloudflared ~/.cloudflare-warp ~/cloudflare-warp /etc/cloudflared /usr/local/etc/cloudflared]
2022-08-10T17:00:47Z INF Version 2022.7.1
2022-08-10T17:00:47Z INF GOOS: linux, GOVersion: go1.17.1, GoArch: amd64
2022-08-10T17:00:47Z INF Settings: map[no-autoupdate:true token:*****]
2022-08-10T17:00:47Z INF Generated Connector ID: f9147c6d-a615-4286-aefe-ab3498ee1205
2022-08-10T17:00:47Z INF Will be fetching remotely managed configuration from Cloudflare API. Defaulting to protocol: quic
2022-08-10T17:00:47Z INF Initial protocol quic
2022-08-10T17:00:47Z INF Starting metrics server on 127.0.0.1:40785/metrics
2022-08-10T17:00:49Z INF Connection 5a87c9da-628c-4d13-8260-cc87e90c9ded registered connIndex=0 ip=198.41.200.63 location=JNB
2022-08-10T17:00:49Z INF Updated to new configuration config="{\"ingress\":[{\"hostname\":\"jenkins_webhook.piii314.tk\",\"originRequest\":{\"httpHostHeader\":\"\"},\"service\":\"https://localhost:8080\"},{\"service\":\"http_status:404\"}],\"warp-routing\":{\"enabled\":false}}" version=13
2022-08-10T17:00:50Z INF Connection 3d648068-fc89-4ff2-a135-bb55998ce6f5 registered connIndex=2 ip=198.41.200.193 location=JNB
2022-08-10T17:00:51Z INF Connection ef523b57-6908-4c03-bce5-a27af7a3fac8 registered connIndex=1 ip=198.41.192.167 location=CPT
2022-08-10T17:00:52Z INF Connection 702a4312-27f2-4d05-8434-f2061d97e98f registered connIndex=3 ip=198.41.192.7 location=CPT
2022-08-10T17:01:36Z INF Updated to new configuration config="{\"ingress\":[{\"service\":\"http://localhost:8080\",\"hostname\":\"jenkins_webhook.piii314.tk\",\"originRequest\":{\"httpHostHeader\":\"\"}},{\"service\":\"http_status:404\"}],\"warp-routing\":{\"enabled\":false}}" version=14
2022-08-10T17:04:19Z ERR  error="Unable to reach the origin service. The service may be down or it may not be responding to traffic from cloudflared: dial tcp 127.0.0.1:8080: connect: connection refused" cfRay=738a4f594ddf9e94-JNB ingressRule=0 originService=http://localhost:8080
2022-08-10T17:04:19Z ERR Request failed error="Unable to reach the origin service. The service may be down or it may not be responding to traffic from cloudflared: dial tcp 127.0.0.1:8080: connect: connection refused" connIndex=0 dest=https://jenkins_webhook.piii314.tk/ ip=198.41.200.63 type=http
2022-08-10T17:04:20Z ERR  error="Unable to reach the origin service. The service may be down or it may not be responding to traffic from cloudflared: dial tcp 127.0.0.1:8080: connect: connection refused" cfRay=738a4f60097d9e94-JNB ingressRule=0 originService=http://localhost:8080
2022-08-10T17:04:20Z ERR Request failed error="Unable to reach the origin service. The service may be down or it may not be responding to traffic from cloudflared: dial tcp 127.0.0.1:8080: connect: connection refused" connIndex=0 dest=https://jenkins_webhook.piii314.tk/favicon.ico ip=198.41.200.63 type=http

我可能做错什么了吗?

谢谢。

EN

回答 1

Stack Overflow用户

发布于 2022-08-17 21:53:36

因此,我不理解“为什么”,但经过反复试验,我找到的解决方案是使用容器IP而不是localhost。

所以这就像172.17.0.#:8080从你的localhost:8080

希望这有帮助

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/73310435

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档