A while back, I set up a Docker image for Nextcloud on my host, and successfully set up a Reverse Proxy from a public-facing webserver to help serve up Nextcloud. Long story short, my host crashed, and I had to rebuild my webserver from scratch. The docker image survived, and is running fine, but for the life of me, I cannot get the Proxy to work again, and I can’t restore from backup for the proxy.
The docker image is up and running fine - I can browse it by IP if I disable URL rewrite. The problem is solely with the Apache2 Reverse Proxy.
The docker is using a self-signed SSL cert. I remember having to set the Proxy to tolerate this, but my internal notes are lacking, and I can’t find how I did it properly the first time any more.
I looked at the AIO Proxy guide, and tried to follow it, but I’m still getting a 500 Internal Server error when trying to proxy to the Nextcloud instance. I’ll post my Apache config below, any insight as to what I am missing would be appreciated.
SuexecUserGroup #1001 #1001
ServerName cloud.aiskon.net
DocumentRoot /home/aiskon/domains/cloud.aiskon.net/public_html
ErrorLog /var/log/virtualmin/cloud.aiskon.net_error_log
CustomLog /var/log/virtualmin/cloud.aiskon.net_access_log combined
ScriptAlias /cgi-bin/ /home/aiskon/domains/cloud.aiskon.net/cgi-bin/
DirectoryIndex index.php index.htm index.html
<Directory /home/aiskon/domains/cloud.aiskon.net/public_html>
Options -Indexes +IncludesNOEXEC +SymLinksIfOwnerMatch
Require all granted
AllowOverride All Options=ExecCGI,Includes,IncludesNOEXEC,Indexes,MultiViews,SymLinksIfOwnerMatch
</Directory>
<Directory /home/aiskon/domains/cloud.aiskon.net/cgi-bin>
Require all granted
AllowOverride All Options=ExecCGI,Includes,IncludesNOEXEC,Indexes,MultiViews,SymLinksIfOwnerMatch
</Directory>
# Reverse proxy based on https://httpd.apache.org/docs/current/mod/mod_proxy_wstunnel.html
RewriteEngine On
ProxyPreserveHost On
RequestHeader set X-Real-IP %{REMOTE_ADDR}s
AllowEncodedSlashes NoDecode
# Adjust the two lines below to match APACHE_PORT and APACHE_IP_BINDING. See https://github.com/nextcloud/all-in-one/blob/main/reverse-proxy.md#adapting-the-sample-web-server-configurations-below
ProxyPass / https://10.0.0.253:11000/ nocanon
ProxyPassReverse / https://10.0.0.253:11000/
SSLEngine on
SSLCertificateFile /home/aiskon/ssl.combined
SSLCertificateKeyFile /home/aiskon/ssl.key
SSLCACertificateFile /home/aiskon/ssl.ca
SSLProtocol all -SSLv2 -SSLv3 -TLSv1 -TLSv1.1
RewriteCond %{HTTP:UPGRADE} ^WebSocket$ [NC]
RewriteCond %{HTTP:CONNECTION} ^Upgrade$ [NC]
RewriteRule ^/?(.*) "wss://10.0.0.253:11000/$1" [P]
SSLProxyCheckPeerCN off
SSLProxyCheckPeerName off
SSLProxyCheckPeerExpire off
SSLHonorCipherOrder off
SSLSessionTickets off