Mattermost notifications, Validations failed when both gitlab and mattermost are hosted on the same server

Summary

Mattermost notification cannot be activated with error message "Validations failed. Webhook is blocked: Requests to localhost are not allowed".

GitLab installation version: 11.0.0 (b84bfb5d)

Steps to reproduce

  1. Configure gitlab and mattermost with Let's Encrypt https on the same host
  2. In mattermost, enable webhook and create the url
  3. In a project of gitlab -> Settings -> Integrations -> Mattermost notifications, input the webhook url, select "Active" and click "Test settings and save changes"
  4. Error message "Validations failed. Webhook is blocked: Requests to localhost are not allowed" is shown

What is the current bug behavior?

Mattermost notification cannot be activated

What is the expected correct behavior?

Mattermost notification can be activated

Relevant logs and/or screenshots

gitlab_mattermost_bug

Edited by Dan Lee