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 (local nextcloud server) it will automatically convert it to an encrypted connection, i.e. 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):

NGiNX config (on nextcloud server):

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, or specify the port
‘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 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:
Defaults to '' (empty string)
‘overwritecondaddr’ => ‘’,

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

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

In this case your connection will go over reverse proxy.