问题描述
我正在尝试在GitHub上配置Web挂钩,以便它可以将POST发送到 http://127.0.0.1:8080/github-webhook/
I am trying to configure the web hook on GitHub so that it can send the POST to http://127.0.0.1:8080/github-webhook/
我的Jenkins在 http://127.0.0.1:8080
My Jenkins is running on http://127.0.0.1:8080
这是我的GitHub Web钩子配置:
And here is my GitHub web hook configuration:
然后出现以下错误:
And I get the following error:
我的Jenkins确实在 http://127.0.0.1:8080/上运行.因此,这肯定不是问题.
My Jenkins is running for sure on http://127.0.0.1:8080/. So, that is not a problem for sure.
推荐答案
GitHub不知道如何联系本地主机"或127.0.0.1
:GitHub认为本地"的是 not 您的本地机器.
GitHub would not know how to contact "localhost" or 127.0.0.1
: what GitHub would consider "local" is not your local machine.
您需要指定GitHub可以通过互联网联系的IP地址.不只是"localhost".
You need to specify an IP address GitHub can contact over the internet. Not just "localhost".
这意味着您的PC必须将8080端口公开到Internet.
例如,这可能涉及在路由器上打开该端口.
或者,在工作中,向您的IT部门请求防火墙规则,以允许该端口上的流量.
That means your PC must expose to the internet the port 8080.
That can involve opening said port on your router for instance.
Or, at work, requesting from your IT department a firewall rule to allow traffic on that port.
这篇关于Jenkins + Github:我们无法提供此有效负载:无法连接到服务器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!