Nextcloud with Apache reverse proxy



I use two virtuals machines, one with Nextcloud ( and one with a reverse proxy Apache (
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
ProxyPassReverse /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:


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’ => ‘^$’,
‘overwrite.cli.url’ => ‘https://app.***.net/nextcloud/’, is IP of my reverse Proxy is IP of my Nextcloud server

Configuration of my Apache Reverse Proxy :
ProxyPass /nextcloud
ProxyPassReverse /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.



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