Nextcloud with Apache reverse proxy

Hello,

Hello,

I use two virtuals machines, one with Nextcloud (192.168.1.5) and one with a reverse proxy Apache (192.168.1.3).
The system is a Ubuntu 16.04 and it is a fresh install of Nextcloud.
I want to access Nextcloud with https and reverse proxy with this type of url : https://app.****.net/nextcloud

I have config my apache reverse proxy like this :

ProxyPass /nextcloud http://192.168.1.5/nextcloud
ProxyPassReverse /nextcloud http://192.168.1.5/nextcloud

When I go to https://app.****.net/nextcloud I have the login page :
I try to login with my login/password, the login doesn’t work and redirect to this page : /nextcloud/index.php/login?redirect_url=/nextcloud/index.php/apps/files/

Same with incorrect login/password, and the page doesn’t show Wrong password.

I have try many config in my file config/config.php but doesn’t work…

Can you help me ?

Thank you in advance

Anybody to help me ?

What config did you try in config.php? I think this is what you need:

https://docs.nextcloud.com/server/12/admin_manual/configuration_server/config_sample_php_parameters.html#proxy-configurations

Hello,

I’m coming back to you for this problem, it’s solved…
My Config in config.php is
’overwritehost’ => ‘app.***.net’,
‘overwriteprotocol’ => ‘https’,
‘overwritewebroot’ => ‘/nextcloud’,
‘overwritecondaddr’ => ‘^192.168.1.3$’,
‘overwrite.cli.url’ => ‘https://app.***.net/nextcloud/’,

192.168.1.3 is IP of my reverse Proxy
192.168.1.5 is IP of my Nextcloud server

Configuration of my Apache Reverse Proxy :
ProxyPass /nextcloud http://192.168.1.5/nextcloud
ProxyPassReverse /nextcloud http://192.168.1.5/nextcloud
ProxyPassReverseCookiePath /nextcloud /nextcloud

The problem is the cookie… When many sites was activated in the reverse proxy, the cookie has a bad url… So the directive ProxyPassReverseCookiePath solved my problem.

Cordially

2 Likes

You are a freaking genius. Thanks. I made my config work that way too on my 19.0.1 install.