Setting up Nextcloud Locally

I have a current setup where there is an NGiNX reverse proxy that handles all requests and SSL termination but I also have computers on the same local network. I also have OnlyOffice Document Server connected to Nextcloud.

Right now if I try to visit http://192.168.1.101 (local nextcloud server) it will automatically convert it to an encrypted connection, i.e. https://192.168.1.101 and thus the connection would fail.

Here is a diagram of what I want to accomplish:

So how do I handle this properly so where outside computers go through NGiNX reverse proxy and local pc’s to reduce the latency?

Here is the config files I have so far:

config.php (nextcloud):

https://hastebin.com/labepobatu.php

NGiNX config (on nextcloud server):

https://hastebin.com/ixivumegiv.nginx

Hi Espresso,

you should have the https protocol on both machines, have a look here (from nc docs …)

The automatic hostname detection of Nextcloud can fail in certain reverse proxy and CLI/cron situations. This option allows you to manually override the automatic detection; for example www.example.com, or specify the port www.example.com:8080.
/
‘overwritehost’ => ‘’,
/
*
When generating URLs, Nextcloud attempts to detect whether the server is accessed via https or http. However, if Nextcloud is behind a proxy and the proxy handles the https calls, Nextcloud would not know that ssl is in use, which would result in incorrect URLs being generated.
Valid values are http and https.
/
‘overwriteprotocol’ => ‘’,
/
*
Nextcloud attempts to detect the webroot for generating URLs automatically. For example, if www.example.com/nextcloud is the URL pointing to the Nextcloud instance, the webroot is /nextcloud. When proxies are in use, it may be difficult for Nextcloud to detect this parameter, resulting in invalid URLs.
/
‘overwritewebroot’ => ‘’,
/
*
This option allows you to define a manual override condition as a regular expression for the remote IP address. For example, defining a range of IP addresses starting with 10.0.0. and ending with 1 to 3:
^10\.0\.0\.[1-3]$
Defaults to '' (empty string)
*/
‘overwritecondaddr’ => ‘’,

FYI: I can not read your pastebin’s. Do not know why.

If you added your “host” e.g. myNC.com into hosts file on local PC with local IP 192.168.1.101, your https should work properly. Example of hosts:

192.168.1.101    myNC.com

In this case your connection will go over reverse proxy.