After upgrading GitLab, you may encounter the error “Url is blocked: Requests to the local network are not allowed” as illustrated in the screenshot below while trying to create triggers to your Jenkins instance.
If you have, then chill out and follow the steps below. It is a security feature that blocks all traffic in GitLab unless you explicitly allow where to or from. At the end of the day, it is a pretty cool feature.
Now, to enable egress and ingress traffic for example to send a Webhook trigger to Jenkins server, do the following:
Login to GitLab with an account having administrative capabilities or privileges then navigate as follows. Click on “Menu” > “Admin“.
On the new page, hover over or click “Settings” then hit “Network“.
When the new page loads, look for “Outbound requests“. On the far right of this field, click on “Expand“.
Once Outbound requests field is expanded, you will see a field against a radio button that reads, “Allow requests to the local network from web hooks and services“. Click on the radio button to enable it as shared in the illustration below.
After that, in the text area titled, “Allow requests to the local network from web hooks and services“, add the various IP addresses or domain names of your Jenkins servers as shown in the screenshot above. Use comma, semicolon, or newline to separate multiple entries.
Lastly, once all of your details are well done, click on save changes to make your new configurations persistent. And we should be good to go. You can go to your webhooks and send a test and verify that the error has disappeared.
That is all guys!!
We hope the guide worked for you and your triggers to Jenkins begun working once again as you desire. Thank your for following along, for reading till the end and for the tremendous support you continue to proffer us. We are eternally grateful.