Using Github Webhook with an IP address instead of a URL

I’m trying to set up the integration between Jenkins and Github.

A publicly exposed IP address has been setup. The ‘hooks’ addresses under meta have been whitelisted. Firewall exceptions have also been added.

Under the ‘Payload URL’ section on Github, it’s been set up as: http://xx.xxx.x.xxx/github-webhook/

http://xx.xxx.x.xxx:8080/github-webhook/ has also been tried.

But I’m getting the error: ‘We couldn’t deliver this payload: failed to connect’

I can confirm that we can see incoming traffic from one of the Github webhook IP addresses, so it seems to make the connection to the server.

Please also note, that when the Payload URL was set up using the link generated by NGROK, it worked fine.

What am I missing in this setup?