You add it. The instructions are here: https://docs.mattermost.com/install/install-ubuntu-1604.html#configuring-nginx-as-a-proxy-for-mattermost-server. Although they are in the Ubuntu instructions, the config is the same for every OS. Also, the TLS config might be of interest: https://docs.mattermost.com/install/install-ubuntu-1604.html#configuring-nginx-with-ssl-and-http-2
I'm very interested to see what the solution turns out to be so that I can update the documentation.