Hi all. I would like to run Nextcloud behind an Apache web server set up as a reverse proxy. Both Nextcloud and Apache will be running on the same computer accessible on the web via itâs ip address since Iâm just practicing for now. My configuration is a VPS running Ubuntu 20.04LTS and Nextcloud installed via SNAP, version 19.0.1.1. Letâs say the ip address of the vps is x.x.x.x and when I type that it, Iâm greeted with the Nextcloud login screen.
Next I set Nextcloud to listen on port 444 and enabled https with a self signed certificate. I can still access Nextcloud with a few warnings. Now I want to set it up to be behind the Apache reverse proxy. Iâve tried various combinations of settings learning what I could from other posts but thought it might be time to ask some questions, specifically about what needs to be done in Nextcloudâs config.php.
Should I add localhost to trusted_domains and trusted_proxies?
âtrusted_domainsâ =>
array (
0 => âx.x.x.xâ,
1 => â127.0.0.1â,
),
âtrusted_proxiesâ =>
array (
0 => â127.0.0.1â,
),
And for the parameters found in the documentation (with questions after the parameters):
âoverwritehostâ => âx.x.x.xâ, (Should this be the ip address as seen from a browser? I donât have a DNS record for this machine.)
âoverwriteprotocolâ => âhttpsâ,
âoverwritewebrootâ => â/â,
âoverwritecondaddrâ => â^x.x.x.x$â, (This represents the address that the browser used to reach the Apache proxy, correct?)
âoverwrite.cli.urlâ => âhttp://x.x.x.xâ, (Is this even needed with the latest version of Nextcoud? If so, is this correct?
The Apache virtual hosts file:
/etc/apache2/sites-available/000-default.conf
<VirtualHost *:443>
ProxyPreserveHost On
ProxyPass / https://localhost:444/
ProxyPassReverse / https://localhost:444/
I know more has to be done with the virtual host, for webDAV and calDAV, but shoudlnât this get me to a login screen? Or instead of localhost:444 shoud I be using x.x.x.x:444/ ?
Iâd appreciate any feedback you may have. Thank you.