Reverse Proxy for notify push

Nextcloud version: 22.2.1
Operating system and version: Ubuntu 20.04.2 LTS
Apache or nginx version: Apache/2.4.41
PHP version: 7.4


Hello everyone,

I’m about to put the notify_push app into operation. After a few difficulties, I’m almost done now. I just can’t get the reverse proxy to work.
I get this message
image

I have stored the ProxyPass lines in both the HTTP and HTTPS config of the Apache, but it does not work. I am not so familiar with WebServer … maybe there is an error in the config.

Here is the HTTP config

<VirtualHost *:80>
	ServerAdmin removed@removed.com
	DocumentRoot /var/www/nextcloud
	ServerName share.removed.com
	Redirect permanent / https://share.removed.com
	ProxyPass /push/ws ws://127.0.0.1:7867/ws
	ProxyPass /push/ http://127.0.0.1:7867/
	ProxyPassReverse /push/ http://127.0.0.1:7867/
	ErrorLog ${APACHE_LOG_DIR}/error.log
	CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>

und hier die HTTPS config

<IfModule mod_ssl.c>
	<VirtualHost *:443>
		ServerAdmin removed@removed.com
		ServerName share.removed.com

		<Directory /var/www/nextcloud>
			Satisfy Any
			Require all granted
			AllowOverride All
			Options FollowSymLinks MultiViews
			<IfModule mod_dav.c>
				Dav off
			</IfModule>
		</Directory>

		DocumentRoot /var/www/nextcloud
		Header always set Referrer-Policy "no-referrer"
		Header edit Set-Cookie ^(.*)$ $1;HttpOnly;Secure
		<IfModule mod_headers.c>
			Header always set Strict-Transport-Security "max-age=15552000; includeSubDomains; preload"
			Redirect 301 /.well-known/carddav /remote.php/dav
			Redirect 301 /.well-known/caldav /remote.php/dav
		</IfModule>

# The following lines prevent .htaccess and .htpasswd files from being
# viewed by Web clients.
		<Files ".ht*">
			Require all denied
		</Files>

# Disable HTTP TRACK method.
		RewriteEngine On
		RewriteCond %{REQUEST_METHOD} ^TRACK
		RewriteRule .* - [R=405,L]

		SetEnv HOME /var/www/nextcloud
		SetEnv HTTP_HOME /var/www/nextcloud

		ErrorLog ${APACHE_LOG_DIR}/error.log
		CustomLog ${APACHE_LOG_DIR}/access.log combined
		
# *** Reverse Proxy for Push *************************************************************************
		ProxyPass /push/ws wss://127.0.0.1:7867/ws
		ProxyPass /push/ https://127.0.0.1:7867/
		ProxyPassReverse /push/ https://127.0.0.1:7867/
		
# *** SSL Config *************************************************************************************
		SSLEngine on
		SSLCertificateFile /etc/apache2/ssl.crt/wildcard_removed_com.crt
		SSLCertificateKeyFile /etc/apache2/ssl.key/wildcard_removed_com.key
		SSLCertificateChainFile /etc/apache2/ssl.prm/DigiCertSHA2SecureServerCA.crt


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

Does anyone have any advice on where the error is?

Thank you in advance for your help.

Bye, Ikkarus13

Hello again,

now I have just issued this command

sudo -u www-data php occ notify_push:setup https://share.removed.com/push

and there is no error.
image

Does that mean it works? With this command I still get the error.

sudo -u www-data php occ notify_push:setup

Bye, Ikkarus13

most likely yes, at least you are really close :partying_face:

take a look at this thread there some hints and logs to proof it really works.

Hi there,

Thanks for the hint. I’ve looked at the thread several times, but completely overlooked the one with the logs and the three commands.
Now that I have sent the logs and the three commands, everything really seems to be going well :partying_face: :partying_face:.

Bye, Ikkarus13

1 Like