Ubuntu18 server combining snap install of rocketchat and nextcloud
Sophia Terry
I installed a fresh Ubuntu18 server with Nextcloud and Rocketchat installed through snap.
After enabling letsencrypt, Nextcloud listens on port 443 and Rocketchat on port 3000.
I would like both to listen on port 443 based on domain names without having to deal with their certificates. ( and ).
When I searched, it appears that I should install apache or nginx and do a proxy server. But everything was dealing directly with the certificates, which I would like to avoid. Is it possible ?
1 Answer
This question gave me the hint on how to do and I came to the following config file for an apache reverse proxy:
nextcloud.conf:
LoadModule ssl_module modules/mod_ssl.so
<IfModule mod_ssl.c>
<VirtualHost _default_:443> ServerName nextcloud.example.com SSLProxyEngine On SSLProxyVerify none SSLProxyCheckPeerCN off SSLProxyCheckPeerName off SSLProxyCheckPeerExpire off SSLCertificateFile /var/snap/nextcloud/current/certs/live/fullchain.pem SSLCertificateKeyFile /var/snap/nextcloud/current/certs/live/privkey.pem Proxypass / ProxypassReverse /
</VirtualHost>
</IfModule>rocketchat.conf:
<VirtualHost _default_:443> ServerName rocketchat.example.com SSLCertificateFile /etc/letsencrypt/live/ SSLCertificateKeyFile /etc/letsencrypt/live/ <Location /> Order allow,deny Allow from all </Location> RewriteEngine On RewriteCond %{HTTP:Upgrade} =websocket [NC] RewriteRule /(.*) ws://localhost:3000/$1 [P,L] RewriteCond %{HTTP:Upgrade} !=websocket [NC] RewriteRule /(.*) [P,L] ProxyPassReverse /
</VirtualHost> 1