I have a matrix home server and a Django web app sitting on VMs at 192.168.81 and 192.168.83 respectively. The home server is built with matrix-docker-ansible-deploy and runs on nginx. It obtains and renews SSL certificates through Traefik with Let's encrypt.
The web app uses a Let's Encrypt certificate of its own. Though I can get and have gotten them to work independently, I am having trouble getting them to work together, on the same 80 and 443 ports.
After setting up reverse proxy on the web app side to divert traffic from its domain, like so:
SSLEngine On
SSLCertificateFile /etc/letsencrypt/live/mysite.org/cert.pem
SSLCertificateKeyFile /etc/letsencrypt/live/mysite.org/privkey.pem
SSLCertificateChainFile /etc/letsencrypt/live/mysite.org/fullchain.pem
# Enable SSL Proxy Engine
SSLProxyEngine On
ProxyPass / https://192.168.1.83/
ProxyPassReverse / https://192.168.1.83/
I get:
[Wed Jan 17 07:13:21.567813 2024] [core:notice] [pid 33994:tid 125031783462784] AH00094: Command line: '/usr/sbin/apache2'
[Wed Jan 17 07:15:23.409061 2024] [proxy:error] [pid 34272:tid 125031640188608] (20014)Internal error (specific information not available): [client 192.168.1.85:44054] AH01084: pass request body failed to 192.168.1.83:443 (192.168.1.83)
[Wed Jan 17 07:15:23.409180 2024] [proxy:error] [pid 34272:tid 125031640188608] [client 192.168.1.85:44054] AH00898: Error during SSL Handshake with remote server returned by /
[Wed Jan 17 07:15:23.409209 2024] [proxy_http:error] [pid 34272:tid 125031640188608] [client 192.168.1.85:44054] AH01097: pass request body failed to 192.168.1.83:443 (192.168.1.83) from 192.168.1.85 ()
[Wed Jan 17 07:15:23.715825 2024] [proxy:error] [pid 34273:tid 125031648581312] (20014)Internal error (specific information not available): [client 192.168.1.85:44070] AH01084: pass request body failed to 192.168.1.83:443 (192.168.1.83), referer: https://192.168.1.83/
[Wed Jan 17 07:15:23.715945 2024] [proxy:error] [pid 34273:tid 125031648581312] [client 192.168.1.85:44070] AH00898: Error during SSL Handshake with remote server returned by /favicon.ico, referer: https://192.168.1.83/
[Wed Jan 17 07:15:23.715970 2024] [proxy_http:error] [pid 34273:tid 125031648581312] [client 192.168.1.85:44070] AH01097: pass request body failed to 192.168.1.83:443 (192.168.1.83) from 192.168.1.85 (), referer: https://192.168.1.83/
Update:
Since running the two servers on the same port would almost certainly mess up the SSL certification (unless we want them to share the same cert and use a reverse proxy on a separate server to redirect traffic from the separate domains to their own respective internal servers), I would like to use ports other than 80 and 443 to host my web app.
How should I go about doing this?