The Basics
- Nextcloud Server version:
- Nextcloud AIO v10.11.10
- Operating system and version:
- Debian 12 / Centos 7
- Reverse proxy and version:
- Apache
- Installation method:
- Docker AIO
Summary of the issue you are facing:
With docker I’ve managed to install Nextcloud_AIO, with almost no problems. This runs on a Debian host, connected to my local network (192.168.1.179).
I have a public web server (Apache) running without problems on a Centos 7 host, also connected to the local network.
I now want to use the public web server as reverse proxy, forwarding requests for “nextcloud.mydomain.dk” to the Debian host. I’ve followed the recommendations here, but can’t make it work.
In a browser, opening https://192.168.1.179:8080/ works flawlessly.
But trying to open https://nextcloud.mydomain.dk/ in a browser results in “This site can’t provide a secure connection” and “ERR_SSL_PROTOCOL_ERROR”
From another host on the local network, I can connect with curl to https://nextcloud.mydomain.dk/login, this works with no error, selecting TLSv1.3
So I guess this is some kind of certificate / TLS problem?
Below is my configuration of the proxy in Apache’s httpd.conf. I had to remove TLSv1.3 from the list of SSLProtocols in order to make Apache accept the configuration.
<VirtualHost *:80>
ServerName nextcloud.mydomain.dk
RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI}
RewriteCond %{SERVER_NAME} nextcloud.mydomain.dk
RewriteRule ^ https://%{SERVER_NAME}%{REQUEST_URI} [END,NE,R=permanent]
</VirtualHost>
<VirtualHost *:443>
ServerName nextcloud.mydomain.dk
# 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 / http://192.168.1.179:11000/ nocanon
ProxyPassReverse / http://192.168.1.179:11000/
RewriteCond %{HTTP:Upgrade} websocket [NC]
RewriteCond %{HTTP:Connection} upgrade [NC]
RewriteCond %{THE_REQUEST} "^[a-zA-Z]+ /(.*) HTTP/\d+(\.\d+)?$"
# RewriteRule .? "ws://192.168.1.179:11000/%1" [P,L,UnsafeAllow3F] # Adjust 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
RewriteRule .? "ws://192.168.1.179:11000/%1" [P,L] # Adjust 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
# Enable h2, h2c and http1.1
# Protocols h2 h2c http/1.1
# Solves slow upload speeds caused by http2
# H2WindowSize 5242880
# TLS
SSLEngine on
# SSLProtocol -all +TLSv1.2 +TLSv1.3
SSLProtocol -all +TLSv1.2
SSLCipherSuite ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:DHE-RSA-AES128-GCM-SHA256:DHE-RSA-AES256-GCM-SHA384:DHE-RSA-CHACHA20-POLY1305
SSLHonorCipherOrder off
SSLSessionTickets off
# If running apache on a subdomain (eg. nextcloud.example.com) of a domain that already has an wildcard ssl certificate from certbot on this machine,
# the <your-nc-domain> in the below lines should be replaced with just the domain (eg. example.com), not the subdomain.
# In this case the subdomain should already be secured without additional actions
SSLCertificateFile /etc/dehydrated/certs/mydomain.dk/fullchain.pem
SSLCertificateKeyFile /etc/dehydrated/certs/mydomain.dk/privkey.pem
# Disable HTTP TRACE method.
TraceEnable off
<Files ".ht*">
Require all denied
</Files>
# Support big file uploads
LimitRequestBody 0
Timeout 86400
ProxyTimeout 86400
</VirtualHost>