Mattermost, omnibus, Nginx reverse proxy (+ ssl offloading)

I try to install mattermost on my gitlab instance. My gitlab is installed in a LXC container, so http request pass throught in a NGINX proxy (on the host), which also make SSL offloading:

httpS://mygitlab.mydomain.fr --> NGINX (on host) -- http (no more S) --> NGINX (omnibus)

Gitlab is installed with omnibus, in version 8.1.4.

When I try to create a team with the gitlab server, Mattermost redirect me on the Gitlab page :

Authorize required
Authorize GitLab Mattermost to use your account?
This application will be able to:
    Access your API

When I click on Authorize I got the following error :

GitLab Mattermost needs your help: Token request failed

My NGINX proxy configuration :

server {
   listen 443;
   server_name mygitlab.mydomain.fr mymattermost.mydomain.fr;
   ssl_certificate /etc/ssl/certs/mydomain.crt;
   ssl_certificate_key /etc/ssl/private/mydomain.key;
   access_log off;
   large_client_header_buffers 4 16k;
   location / {
       proxy_pass http://192.168.201.227:80/;
       proxy_cache off;
       proxy_set_header Host $host;
       proxy_set_header X-Real-IP $remote_addr;
       proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
   }
}

(my certificate is a wildcard)

My gitlab.rb

external_url 'http://mygitlab.mydomain.fr'
gitlab_rails['gravatar_ssl_url'] = 'https://secure.gravatar.com/avatar/%{hash}?s=%{size}&d=identicon'
mattermost_external_url 'http://mymattermost.mydomain.fr'

Thanks a lot