Hello again! Here is my SSL Apache Configuration file, slightly redacted though.
<IfModule mod_ssl.c>
<VirtualHost *:443>
# If you're not using a subdomain you may need to set a ServerAlias to:
# ServerAlias www.mydomain.com
ServerName <REDACTED>
ServerAdmin [REMOVED]@<REDACTED>
ProxyPreserveHost On
DocumentRoot /opt/mattermost
# For the IP logging we run on all domains/subdomains, header
# provides real user IP when behind Cloudflare
RemoteIPHeader CF-Connecting-IP
# Mattermost Config
# Set web sockets
ProxyRequests Off
RewriteEngine On
RewriteCond %{REQUEST_URI} ^/api/v3/users/websocket [NC,OR]
RewriteCond %{HTTP:UPGRADE} ^WebSocket$ [NC,OR]
RewriteCond %{HTTP:CONNECTION} ^Upgrade$ [NC]
RewriteRule .* ws://127.0.0.1:8065%{REQUEST_URI} [P,QSA,L]
RewriteCond %{DOCUMENT_ROOT}/%{REQUEST_FILENAME} !-f
RewriteRule .* http://127.0.0.1:8065%{REQUEST_URI} [P,QSA,L]
RequestHeader set X-Forwarded-Proto "https"
<Location /api/v4/users/websocket>
Require all granted
ProxyPassReverse ws://127.0.0.1:8065/api/v4/users/websocket
ProxyPassReverseCookieDomain 127.0.0.1 <REDACTED>
</Location>
<Location />
Require all granted
ProxyPassReverse https://127.0.0.1:8065/
ProxyPassReverseCookieDomain 127.0.0.1 <REDACTED>
</Location>
# End Mattermost Config
#Custom Error Pages
ErrorDocument 401 /srv/<REDACTED>/error/401
ErrorDocument 403 /srv/<REDACTED>/error/403
ErrorDocument 404 /srv/<REDACTED>/error/404
ErrorDocument 500 /srv/<REDACTED>/error/500
#Block access to the .git folder from the webserver (Security Enhancement)
RedirectMatch 404 /\.git
Include /etc/letsencrypt/options-ssl-apache.conf
SSLEngine on
SSLVerifyClient require
SSLVerifyDepth 1
#Cloudflare Authenticated Origin Pull Certificate
SSLCACertificateFile /root/origin-pull-ca.pem
#Domain name SSL Certs. configuration
SSLCertificateFile /etc/letsencrypt/live/<REDACTED>/fullchain.pem
SSLCertificateKeyFile /etc/letsencrypt/live/<REDACTED>/privkey.pem
</VirtualHost>
</IfModule>
I know there is a bit of extra stuff in there but I wanted to provide what I know is fully functional for me personally and my team. Does this help?
If you have any questions or encounter any issues, please don’t hesitate to ask them, I’m more than happy to help however I can!