For troubleshooting questions, please post in the following format:
Summary
Issue in one concise sentence
I now have 3 different virtual machine servers (mattermost server, mysql server and nginx server)
how to map my nginx proxy to my mattermost server
mattermost server ip:192.168.242.181
mysql server ip:192.168.242.182
nginx server ip:192.168.242.183
Steps to reproduce Install Mattermost on RHEL 8 — Mattermost documentation (i follo this docs)
How can we reproduce the issue (what version are you using?)
mattermost server 7.10.0 Expected behavior
Describe your issue in detail
I used DNS challenge to get my letsencrypt cert however when put my dns which it is not https but http Observed behavior
What did you see happen? Please include relevant error messages and/or screenshots.
Since you already installed nginx and Let’s Encrypt, etc., you probably will only be interested in the part of the configuration that does the reverse proxy to the Mattermost application server. The example configuration you can see in the docs points to 10.10.10.2:8065 for the Mattermost application server, you should replace that with 192.168.242.182:8065 in your setup.
You need to install the Let’s Encrypt certificate to the nginx proxy then and it will take care of the SSL handling and forward unencrypted traffic to the Mattermost application server then.
since your nginx is on its own VM separate from the mattermost box, the main thing to get right is that nginx just needs to reach the mattermost server over your internal network on port 8065 (thats mattermost’s default). so in your server block you point proxy_pass at http://192.168.242.181:8065 (your mattermost VM), not localhost, since theyre on different machines. mysql doesnt come into this at all, nginx never talks to it, only mattermost does.
for the https part you terminate the cert on the nginx VM with lets encrypt like you already started, and nginx talks to mattermost over plain http internally on 8065. the two gotchas that bite everyone: you need the websocket upgrade headers on the /api/v4/websocket location or the app loads fine but messages dont live update, and you have to set SiteURL in mattermost’s config to your real https url (https://yourdomain) otherwise it generates broken links and the security checks start complaining. the official nginx reverse proxy page in the mattermost docs has a copy paste server block that already includes the websocket bits, you just swap in your mattermost VM’s internal ip as the upstream instead of localhost.
honestly the 3-VM split (separate nginx, mattermost, mysql) is more moving parts than most self hosters need at home, its more of a production pattern. if youre doing it to learn the wiring then great, thats the best way to actually understand it. but if you just want mattermost reachable over https without hand maintaining the proxy and cert renewal, full disclosure im involved in an open source project called syncloud where mattermost is a one click install and the https and reverse proxy are handled for you on a single box. either way the proxy_pass to :8065 plus the websocket headers is the piece youre missing right now.