HOWTO - What to do for having Nextcloud / OnlyOffice on the same host?

Hello NEmskiller,
I tried your TUTO. I think i’m nearly there. I’ve a problem with the proxy part. If I try to start Apache2 again, I get an error on the proxypass URL:

sep 16 21:14:40 t53n-nextcloud apachectl[5957]: AH00526: Syntax error on line 31
sep 16 21:14:40 t53n-nextcloud apachectl[5957]: ProxyPass Unable to parse URL: \
sep 16 21:14:40 t53n-nextcloud apachectl[5957]: Action 'start' failed.  

Line 31 of my office-ssl.conf contains:
ProxyPassMatch (.*)(/websocket)$ “ws://127.0.0.1/$1$2”

OnlyOffice is running, I have the 127.0.0.1/welcome screen.

Ok, This isn’t a problem anymore. I forgot the http:// bit in the lines below line 31.
I can start Apache2 now and OnlyOffice is still running.

The symptoms:

  • When I go to the URL https://office.mysite.nl. I get an error and the URL changes to: https://(null)/welcome
  • When I go to https://office.mysite.nl/healthcheck It returns ‘True’ in the browser and the browser URL stays intact.
  • The log on my Nextcloud instance when I try to save OnlyOffice settings: “file_get_contents(https://office.url.com/healthcheck): failed to open stream: Connection refused at /var/www/html/nextcloud/apps/onlyoffice/lib/documentservice.php#381”

Any ideas on this? Could it be a permission issue?

This is my conf file:

<IfModule mod_ssl.c>
<VirtualHost *:4433>
	ServerAdmin ****@protonmail.com
    Servername office.url.com

	DocumentRoot /var/www/onlyoffice
<IfModule mod_headers.c>
  Header always set Strict-Transport-Security "max-age=15552000; includeSubDomains"
</IfModule>
	ErrorLog ${APACHE_LOG_DIR}/error.log
	CustomLog ${APACHE_LOG_DIR}/access.log combined

	SSLEngine on
	SSLCertificateFile	/etc/ssl/certs/office.crt
	SSLCertificateKeyFile /etc/ssl/private/office.key

		SetEnvIf Host “^(.*)$” THE_HOST=$1
		RequestHeader setifempty X-Forwarded-Proto https
		RequestHeader setifempty X-Forwarded-Host %{THE_HOST}e
		ProxyAddHeaders Off

	SSLProxyEngine on
    ProxyPassMatch (.*)(/websocket)$ "ws://127.0.0.1/$1$2"
	ProxyPass / "http://127.0.0.1/"
	ProxyPassReverse / "http://127.0.0.1"

	<FilesMatch "\.(cgi|shtml|phtml|php)$">
			SSLOptions +StdEnvVars
	</FilesMatch>
	<Directory /usr/lib/cgi-bin>
			SSLOptions +StdEnvVars
	</Directory>

</VirtualHost>