# No LAN Access to nextcloud, but external access is fine

**URL:** <https://help.nextcloud.com/t/no-lan-access-to-nextcloud-but-external-access-is-fine/124301>\
**Category:** ℹ️ Support\
**Tags:** reverseproxy, nc20\
**Created:** [September 25, 2021, 4:51pm UTC](https://help.nextcloud.com/t/no-lan-access-to-nextcloud-but-external-access-is-fine/124301 "2021-09-25T16:51:39Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![andib90](https://help.nextcloud.com/letter_avatar/andib90/32/6_22734026db12803ebb3e059622ac3534.png) [@andib90](https://help.nextcloud.com/u/andib90)\
**Post date:** [September 25, 2021, 4:51pm UTC](https://help.nextcloud.com/t/no-lan-access-to-nextcloud-but-external-access-is-fine/124301/1 "2021-09-25T16:51:39Z")

</div>

Hi i am facing the problem that i am not able to connect to my nextcloud inside my network. Connection to my nextcloud from outside my network works fine…

I am running nextcloud on a FreeNas system. My Setup is as follows:

1. I am having a nginx reverse proxy which is handling all the traffic and takes care for https certificate (IP:192.168.0.9)
2. nextcloud is running on apache24. (IP: 192,168.0.10)
3. on my router i have openned port 443 and 80 (tcp/udp)

I post my config files, so you can help me 😃

config.php

```auto
<?php
$CONFIG = array (
  'apps_paths' =>
  array (
    0 =>
    array (
      'path' => '/usr/local/www/nextcloud/apps',
      'url' => '/apps',
      'writable' => true,
    ),
    1 =>
    array (
      'path' => '/usr/local/www/nextcloud/apps-pkg',
      'url' => '/apps-pkg',
      'writable' => false,
    ),
  ),
  'overwriteprotocol' => 'https',
  'logfile' => '/var/log/nextcloud/nextcloud.log',
  'memcache.local' => '\\OC\\Memcache\\APCu',
  'instanceid' => '---',
  'passwordsalt' => '---',
  'secret' => '---',
  'trusted_domains' =>
  array (
    0 => '192.168.0.10',
    1 => 'nextcloud.myserver.com,
  ),
  'trusted_proxies' => ['192.168.0.9'],
  'datadirectory' => '/mnt/data',
  'dbtype' => 'mysql',
  'version' => '20.0.12.1',
  'overwrite.cli.url' => '192.168.0.10',
  'dbname' => 'nextcloud',
  'dbhost' => 'localhost:/tmp/mysql.sock',
  'dbport' => '',
  'dbtableprefix' => 'oc_',
  'mysql.utf8mb4' => true,
  'dbuser' => '---',
  'dbpassword' => '---',
  'installed' => true,
  'redis' =>
  array (
    'host' => '/tmp/redis.sock',
    'port' => 0,
  ),
  'memcache.locking' => '\\OC\\Memcache\\Redis',
  'maintenance' => false,
  'theme' => '',
  'loglevel' => 0,
);

```

nginx.conf

```auto
worker_processes 1;

events {
    worker_connections 1024;
}

http {
    include mime.types;
    default_type application/octet-stream;
    sendfile on;
    keepalive_timeout 65;

    # Redirect all HTTP traffic to HTTPS
    server {

        listen 80 default_server;
        listen [::]:80;

        return 301 https://$host$request_uri;
    }

    # Import server blocks for all subdomains
    include "vdomains/*.conf";
}

```

and the vdomain.conf:

```auto
server {
        listen 443 ssl http2;

        server_name nextcloud.myserver.com;
        access_log /var/log/nginx/nextcloud.access.log;
        error_log /var/log/nginx/nextcloud.error.log;

        include snippets/myserver.cert.conf;
        include snippets/ssl-params.conf;

        location / {
                include snippets/proxy-params.conf;
                proxy_pass http://192.168.0.10;
        }
        location /.well-known/carddav {
                return 301 $scheme://$host/remote.php/dav;
        }
        location /.well-known/caldav {
                return 301 $scheme://$host/remote.php/dav;
        }
}

```

Thanks in advance for any help you can provide. In case you need any further information or clarification, just let me know 🙂

to make my point clear:  
I am also not able to access my server from lan when trying :

- 192.168.0.10 → ERR\_CONNECTION\_REFUSED
- nextcloud.blendl.info → ERR\_CONNECTION\_TIMED\_OUT

I allready found out that probably my router is the problem, but at least access via 192.168.0.10 should be possible … 🤕

---

<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:** [September 25, 2021, 7:21pm UTC](https://help.nextcloud.com/t/no-lan-access-to-nextcloud-but-external-access-is-fine/124301/2 "2021-09-25T19:21:43Z")

</div>

most likely you hit different problems.

- Access to https sites via IP always results in certificate error (IP is never part of TLS cert)
- you reverse proxy might not accept connection to direct IP (because it only _listen_ to specific domain name)
- accessing public FQDN from local network might fail because of [rebind protection](https://help.nextcloud.com/search?q=rebind%20protection) of you router

maybe you find this threads useful

> [@Documentation Request / LAN Connectivity Question](https://help.nextcloud.com/t/documentation-request-lan-connectivity-question/106728):
>
> I am new to NextCloud server and I must say the documentation is much better than owncloud and many other open-sources projects. That said, after I successfully installed Nextcloud 20.0.5 on my local machine running Ubuntu 20.04 LTS everything seems to be working flawlessly, then I went to connect my Android mobile phone… only to discover that the server can’t be found on the LAN. No sweat… I went back to [https://docs.nextcloud.com/](https://docs.nextcloud.com/) , expecting to find some official documentation explaining ho…

> [@Nextcloud über Domänenname aus eigenen netzwerk nicht erreichbar](https://help.nextcloud.com/t/nextcloud-uber-domanenname-aus-eigenen-netzwerk-nicht-erreichbar/115735/2):
>
> Oft blockieren die Router Zugriffe auf lokale Geräte über öffentliche URL (Rebind protection). Du findest viele Discussionen zu diesem Thema hier im Forum. [https://help.nextcloud.com/t/documentation-request-lan-connectivity-question/106728/2?u=wwe](https://help.nextcloud.com/t/documentation-request-lan-connectivity-question/106728/2) Oft reicht es die Rebind protection für die eigene Domäne im Router zu deaktivieren.. Je nach Router und verwendeten Clients kann es notwendig sein einen lokalen DNS Server zu verwenden: [https://help.nextcloud.com/t/caldav-calendar-certificate-issue…](https://help.nextcloud.com/t/caldav-calendar-certificate-issue-in-local-network/89269/5)

---

<div class="post-metadata">

**Author:** ![andib90](https://help.nextcloud.com/letter_avatar/andib90/32/6_22734026db12803ebb3e059622ac3534.png) [@andib90](https://help.nextcloud.com/u/andib90)\
**Post date:** [September 25, 2021, 7:55pm UTC](https://help.nextcloud.com/t/no-lan-access-to-nextcloud-but-external-access-is-fine/124301/3 "2021-09-25T19:55:22Z")

</div>

Thank you very much for your reply!

Unfortunately I am not able to figure out how I can establish internal connection via ip again.  
Can you point me a direction or sth. ? 🙂

---

<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:** [September 28, 2021, 8:42pm UTC](https://help.nextcloud.com/t/no-lan-access-to-nextcloud-but-external-access-is-fine/124301/4 "2021-09-28T20:42:36Z")

</div>

take a look at

[https://docs.nextcloud.com/server/stable/admin\_manual/configuration\_server/reverse\_proxy\_configuration.html?highlight=reverse%20proxy](https://docs.nextcloud.com/server/stable/admin_manual/configuration_server/reverse_proxy_configuration.html?highlight=reverse%20proxy)

for me the config setting

> [@andib90](#):
>
> `'overwrite.cli.url' => '192.168.0.10',`

makes no sense - it rewrites all internal URL/links to local IP - which is definitely wrong for both internet and internal setup as all resources are defined as [https://192.168.0.10/xyz](https://192.168.0.10/xyz) and subsequently fail

1. internally as you can’t access .10 with https
2. you can’t access 192.168.x.x from the internet

I would suggest you configure you system to run with https and public DNS name by changing the overwritecli parameter. If this works you can easily access you system locally by adding local DNS record or editing hosts file

---

<div class="post-metadata">

**Author:** ![andib90](https://help.nextcloud.com/letter_avatar/andib90/32/6_22734026db12803ebb3e059622ac3534.png) [@andib90](https://help.nextcloud.com/u/andib90)\
**Post date:** [September 29, 2021, 6:38am UTC](https://help.nextcloud.com/t/no-lan-access-to-nextcloud-but-external-access-is-fine/124301/5 "2021-09-29T06:38:01Z")

</div>

Thank you very much for you answer! Thanks to your help I am again able to acces my nextcloud via lan.  
Next to deleting the overwrite.cli.url statement i also had to delete the ‘overwriteprotocol’ =\> ‘https’, statement, so that my cloud again accepts http.  
I accept this for now, as this is only a workaround until my fritzbox is delivered, where i will be able to circumvent rebind protection.  
Thank you very much 🙂

(Oder auch : Vielen Dank für deine Hilfe!!! )

---

<div class="post-metadata">

**Author:** ![devnull](https://help.nextcloud.com/user_avatar/help.nextcloud.com/devnull/32/27793_2.png) [@devnull](https://help.nextcloud.com/u/devnull)\
**Post date:** [September 29, 2021, 6:53am UTC](https://help.nextcloud.com/t/no-lan-access-to-nextcloud-but-external-access-is-fine/124301/6 "2021-09-29T06:53:12Z")

</div>

You can look **NAT-Loopback** and **Hairpinning**. Perhaps your new Fritzbox can solve your problem.

Please also use then in LAN only your worldwide address [https://nextcloud.blendl.info](https://nextcloud.blendl.info) and not your internal ip. With this configuration /worldwide address you can e.g. not only use correct certificates. You also can use your nextcloud clients (Windows, macOS, Linux, Android, iOS) in your LAN and from internet without modify the configuration or a second profile.

---

<div class="post-metadata">

**Author:** ![warreng](https://help.nextcloud.com/letter_avatar/warreng/32/6_22734026db12803ebb3e059622ac3534.png) [@warreng](https://help.nextcloud.com/u/warreng)\
**Post date:** [February 16, 2022, 8:24pm UTC](https://help.nextcloud.com/t/no-lan-access-to-nextcloud-but-external-access-is-fine/124301/7 "2022-02-16T20:24:58Z")

</div>

With ‘overwriteprotocol’ **not** set to ‘https’ don’t you then suffer from a problem whereby users cannot change their passwords?

> [@"Network Error" for new account at reset password page](https://help.nextcloud.com/t/network-error-for-new-account-at-reset-password-page/74234):
>
> Hello! I am new to nextcloud and really liking the project. I tried to deploy the reference docker-compose project with letsencrypt and setup gmail smtp to onboard new user. reference deployment: But, when the first new user clicks on “set your password” the reset password page is giving me “Network Error” when I tried to reset the password. What is the issue here? I had taken a screenshot below. Thanks for help.

I’m working with a setup where the public address is through a tunnel that takes care of the https security certs etc and initially I could also access over the local LAN with http. But, in order to solve the password issue when users connect over the public tunnel, I enabled the overwriteprotocol =\> https which disables access over the local lan.

Seems like a catch 22.

---

<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 14, 2024, 3:21pm UTC](https://help.nextcloud.com/t/no-lan-access-to-nextcloud-but-external-access-is-fine/124301/8 "2024-12-14T15:21:38Z")

</div>


