# Nextcloud with Apache reverse proxy

**URL:** <https://help.nextcloud.com/t/nextcloud-with-apache-reverse-proxy/19742>\
**Category:** ℹ️ Support\
**Created:** [August 17, 2017, 9:18am UTC](https://help.nextcloud.com/t/nextcloud-with-apache-reverse-proxy/19742 "2017-08-17T09:18:34Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Adrien54](https://help.nextcloud.com/letter_avatar/adrien54/32/5_5575768a8748004e209b776fc1b2916d.png) [@Adrien54](https://help.nextcloud.com/u/Adrien54)\
**Post date:** [August 17, 2017, 9:18am UTC](https://help.nextcloud.com/t/nextcloud-with-apache-reverse-proxy/19742/1 "2017-08-17T09:18:34Z")

</div>

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](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](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

---

<div class="post-metadata">

**Author:** ![Adrien54](https://help.nextcloud.com/letter_avatar/adrien54/32/5_5575768a8748004e209b776fc1b2916d.png) [@Adrien54](https://help.nextcloud.com/u/Adrien54)\
**Post date:** [August 21, 2017, 12:58pm UTC](https://help.nextcloud.com/t/nextcloud-with-apache-reverse-proxy/19742/2 "2017-08-21T12:58:54Z")

</div>

Anybody to help me ?

---

<div class="post-metadata">

**Author:** ![terry\_tibbles](https://help.nextcloud.com/letter_avatar/terry_tibbles/32/5_5575768a8748004e209b776fc1b2916d.png) [@terry\_tibbles](https://help.nextcloud.com/u/terry_tibbles)\
**Post date:** [August 22, 2017, 2:19am UTC](https://help.nextcloud.com/t/nextcloud-with-apache-reverse-proxy/19742/3 "2017-08-22T02:19:53Z")

</div>

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](https://docs.nextcloud.com/server/12/admin_manual/configuration_server/config_sample_php_parameters.html#proxy-configurations)

---

<div class="post-metadata">

**Author:** ![Adrien54](https://help.nextcloud.com/letter_avatar/adrien54/32/5_5575768a8748004e209b776fc1b2916d.png) [@Adrien54](https://help.nextcloud.com/u/Adrien54)\
**Post date:** [February 2, 2018, 2:30pm UTC](https://help.nextcloud.com/t/nextcloud-with-apache-reverse-proxy/19742/4 "2018-02-02T14:30:51Z")

</div>

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](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](http://192.168.1.5/nextcloud)  
ProxyPassReverse /nextcloud [http://192.168.1.5/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

---

<div class="post-metadata">

**Author:** ![realshadow](https://help.nextcloud.com/letter_avatar/realshadow/32/5_5575768a8748004e209b776fc1b2916d.png) [@realshadow](https://help.nextcloud.com/u/realshadow)\
**Post date:** [August 4, 2020, 11:08pm UTC](https://help.nextcloud.com/t/nextcloud-with-apache-reverse-proxy/19742/5 "2020-08-04T23:08:13Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![system](https://help.nextcloud.com/user_avatar/help.nextcloud.com/system/32/29333_2.png) [@system](https://help.nextcloud.com/u/system)\
**Post date:** [September 23, 2024, 4:44pm UTC](https://help.nextcloud.com/t/nextcloud-with-apache-reverse-proxy/19742/6 "2024-09-23T16:44:05Z")

</div>

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.

---

<div class="post-metadata">

**Author:** ![wwe](https://help.nextcloud.com/user_avatar/help.nextcloud.com/wwe/32/72963_2.png) [@wwe](https://help.nextcloud.com/u/wwe)\
**Post date:** [December 9, 2024, 1:32pm UTC](https://help.nextcloud.com/t/nextcloud-with-apache-reverse-proxy/19742/7 "2024-12-09T13:32:14Z")

</div>


