Discourse not using brotli or gzip compression?

Thanks to @Arkshine my issue was fixed.

I had to comment theses lines in /etc/nginx/proxy.inc:

proxy_hide_header Vary;
proxy_set_header Accept-Encoding '';

The server now sends the files properly compressed by Discourse: