# How to disable "You are accessing the server from an untrusted domain."?

**URL:** <https://help.nextcloud.com/t/how-to-disable-you-are-accessing-the-server-from-an-untrusted-domain/4723>\
**Category:** 📦 Appliances (Docker, Snappy, VM, NCP, AIO)\
**Created:** [November 2, 2016, 1:26am UTC](https://help.nextcloud.com/t/how-to-disable-you-are-accessing-the-server-from-an-untrusted-domain/4723 "2016-11-02T01:26:54Z")\
**Posts on this page:** 18\
**Page:** 1

<div class="post-metadata">

**Author:** ![aaronraimist](https://help.nextcloud.com/letter_avatar/aaronraimist/32/6_22734026db12803ebb3e059622ac3534.png) [@aaronraimist](https://help.nextcloud.com/u/aaronraimist)\
**Post date:** [November 2, 2016, 1:26am UTC](https://help.nextcloud.com/t/how-to-disable-you-are-accessing-the-server-from-an-untrusted-domain/4723/1 "2016-11-02T01:26:55Z")

</div>

I have the Nextcloud snap package installed on a server running Ubuntu 16.04.1 LTS. How can I disable the “You are accessing the server from an untrusted domain.” page that pops up when you open up a domain hosted on the same server but not in the trusted\_domains list. I want Nextcloud to only show up on one single subdomain (the only domain in the trusted\_domains list) and not affect any other page.

I assume I would want to edit the VirtualHost, inside the following config file, to specify a ServerName. The problem is when using the snap package, this file is readonly.  
This file is located at `/snap/nextcloud/current/conf/httpd.conf` on my machine.

> <https://github.com/nextcloud/nextcloud-snap/blob/master/src/apache/conf/httpd.conf>

How can I  
(a): edit this file  
or  
(b): disable this page in another way?

---

<div class="post-metadata">

**Author:** ![samerg](https://help.nextcloud.com/user_avatar/help.nextcloud.com/samerg/32/1511_2.png) [@samerg](https://help.nextcloud.com/u/samerg)\
**Post date:** [November 3, 2016, 7:14am UTC](https://help.nextcloud.com/t/how-to-disable-you-are-accessing-the-server-from-an-untrusted-domain/4723/2 "2016-11-03T07:14:36Z")

</div>

As far as I know you need to edit your config.php file and add your domain to this list (in fact I have three entries because of different domains pointing to the same IP, as well as an IP address for clients who connect locally):

```
  'trusted_domains' => 
  array (
    0 => 'your.domain.de',
    1 => 'another.dns.de',
    2 => '192.168.168.30',
  ),

```

This is what I did on my setup and it solved the issue.

Regards,  
Sascha

---

<div class="post-metadata">

**Author:** ![aaronraimist](https://help.nextcloud.com/letter_avatar/aaronraimist/32/6_22734026db12803ebb3e059622ac3534.png) [@aaronraimist](https://help.nextcloud.com/u/aaronraimist)\
**Post date:** [November 3, 2016, 3:32pm UTC](https://help.nextcloud.com/t/how-to-disable-you-are-accessing-the-server-from-an-untrusted-domain/4723/3 "2016-11-03T15:32:50Z")

</div>

I do have that subdomain in the list of trusted domains. Maybe I should clarify, I can access Nextcloud fine on that subdomain. The problem is that this “untrusted domain” page appears on the every single subdomain. Nextcloud just takes all traffic pointed at this box and returns this “untrusted domain” page. I only want Nextcloud to display any type of interface on one single subdomain. I don’t want it to display the “untrusted domain” page on any subdomains or domains that are hosted on this server.

---

<div class="post-metadata">

**Author:** ![nickvergessen](https://help.nextcloud.com/user_avatar/help.nextcloud.com/nickvergessen/32/66965_2.png) [@nickvergessen](https://help.nextcloud.com/u/nickvergessen)\
**Post date:** [November 4, 2016, 7:06am UTC](https://help.nextcloud.com/t/how-to-disable-you-are-accessing-the-server-from-an-untrusted-domain/4723/4 "2016-11-04T07:06:59Z")

</div>

Try to replacing the `*` with the actual domain in

> <https://github.com/nextcloud/nextcloud-snap/blob/master/src/apache/conf/httpd.conf#L182>

And when you use SSL, also in

> <https://github.com/nextcloud/nextcloud-snap/blob/master/src/apache/conf/ssl.conf#L75>

  
and  

> <https://github.com/nextcloud/nextcloud-snap/blob/master/src/apache/conf/ssl.conf#L81>

---

<div class="post-metadata">

**Author:** ![aaronraimist](https://help.nextcloud.com/letter_avatar/aaronraimist/32/6_22734026db12803ebb3e059622ac3534.png) [@aaronraimist](https://help.nextcloud.com/u/aaronraimist)\
**Post date:** [November 5, 2016, 12:30am UTC](https://help.nextcloud.com/t/how-to-disable-you-are-accessing-the-server-from-an-untrusted-domain/4723/5 "2016-11-05T00:30:42Z")

</div>

> [@aaronraimist](#):
>
> I assume I would want to edit the VirtualHost, inside the following config file, to specify a ServerName. The problem is when using the snap package, this file is readonly.  
> This file is located at /snap/nextcloud/current/conf/httpd.conf on my machine.
> 
> How can I  
> (a): edit this file  
> or  
> (b): disable this page in another way?

Yeah that is what I was trying to do except since I have Nextcloud installed via the snap package so these files are readonly. @nickvergessen Do you know how to disable the readonly protection on these files?

---

<div class="post-metadata">

**Author:** ![jdkratz](https://help.nextcloud.com/letter_avatar/jdkratz/32/6_22734026db12803ebb3e059622ac3534.png) [@jdkratz](https://help.nextcloud.com/u/jdkratz)\
**Post date:** [December 30, 2016, 2:07am UTC](https://help.nextcloud.com/t/how-to-disable-you-are-accessing-the-server-from-an-untrusted-domain/4723/6 "2016-12-30T02:07:44Z")

</div>

I don’t know if this is helpful, but I ran into the same issue after installing via the snap package and then turning on TLS with LetsEncrypt. On the “You are accessing the server from an untrusted domain” page, under the error message there’s an option to add the domain (or something along those lines). After clicking that I had to temporarily add the ‘invalid’ cert to my browser, but after that it pulled up the config page in NextCloud and let me add the domain. After that everything is working fine with TLS (and I checked from another machine to make sure it wasn’t from the cert I added).

I realize that doesn’t really answer your question about the read-only filesystem; I tried re-mounting it as rw but couldn’t get that to work, although I’m not very clear on exactly how snaps work.

---

<div class="post-metadata">

**Author:** ![Greg\_Fordyce](https://help.nextcloud.com/user_avatar/help.nextcloud.com/greg_fordyce/32/1947_2.png) [@Greg\_Fordyce](https://help.nextcloud.com/u/Greg_Fordyce)\
**Post date:** [January 4, 2017, 5:58pm UTC](https://help.nextcloud.com/t/how-to-disable-you-are-accessing-the-server-from-an-untrusted-domain/4723/7 "2017-01-04T17:58:52Z")

</div>

What is the location of the config.php file?

---

<div class="post-metadata">

**Author:** ![Greg\_Fordyce](https://help.nextcloud.com/user_avatar/help.nextcloud.com/greg_fordyce/32/1947_2.png) [@Greg\_Fordyce](https://help.nextcloud.com/u/Greg_Fordyce)\
**Post date:** [January 9, 2017, 7:41pm UTC](https://help.nextcloud.com/t/how-to-disable-you-are-accessing-the-server-from-an-untrusted-domain/4723/8 "2017-01-09T19:41:17Z")

</div>

Bump.

Location of config.php on nextcloud box please.

---

<div class="post-metadata">

**Author:** ![Vincent\_Stans](https://help.nextcloud.com/user_avatar/help.nextcloud.com/vincent_stans/32/17415_2.png) [@Vincent\_Stans](https://help.nextcloud.com/u/Vincent_Stans)\
**Post date:** [January 9, 2017, 10:54pm UTC](https://help.nextcloud.com/t/how-to-disable-you-are-accessing-the-server-from-an-untrusted-domain/4723/9 "2017-01-09T22:54:45Z")

</div>

the config.php is found in the nextcloud root directory ex /nextcloud/config/config.php  
mostly location is set at /var/www/[nextcloud\_root]

---

<div class="post-metadata">

**Author:** ![Greg\_Fordyce](https://help.nextcloud.com/user_avatar/help.nextcloud.com/greg_fordyce/32/1947_2.png) [@Greg\_Fordyce](https://help.nextcloud.com/u/Greg_Fordyce)\
**Post date:** [January 10, 2017, 7:47pm UTC](https://help.nextcloud.com/t/how-to-disable-you-are-accessing-the-server-from-an-untrusted-domain/4723/10 "2017-01-10T19:47:49Z")

</div>

This is what I get when I ssh into my machine. I only see 2 folders **php** and **redis** but no config.php file?

```
ubuntu@nextcloud:/snap/nextcloud/current/config$ dir
php redis
ubuntu@nextcloud:/snap/nextcloud/current/config$
```

---

<div class="post-metadata">

**Author:** ![Vincent\_Stans](https://help.nextcloud.com/user_avatar/help.nextcloud.com/vincent_stans/32/17415_2.png) [@Vincent\_Stans](https://help.nextcloud.com/u/Vincent_Stans)\
**Post date:** [January 12, 2017, 3:44am UTC](https://help.nextcloud.com/t/how-to-disable-you-are-accessing-the-server-from-an-untrusted-domain/4723/11 "2017-01-12T03:44:44Z")

</div>

you can find all the config.php files using find  
`sudo find /snap/nextcloud -name config.php`  
This may help you find the config your looking for.

Use “find [NC\_ROOT\_LOCATION] -name [FILE\_NAME]”

ex. output ( **NOT** a snap installation output)  
/var/www/nextcloud/config/config.php  
/var/www/nextcloud/apps/files\_external/lib/config.php  
/var/www/nextcloud/apps/gallery/controller/config.php

I found a place where they say /var/snap/nextcloud/current/nextcloud/config/config.php  
as I do not use snap myself I can’t confirm.

---

<div class="post-metadata">

**Author:** ![Stuart\_Naylor](https://help.nextcloud.com/user_avatar/help.nextcloud.com/stuart_naylor/32/2359_2.png) [@Stuart\_Naylor](https://help.nextcloud.com/u/Stuart_Naylor)\
**Post date:** [January 12, 2017, 4:18am UTC](https://help.nextcloud.com/t/how-to-disable-you-are-accessing-the-server-from-an-untrusted-domain/4723/12 "2017-01-12T04:18:20Z")

</div>

If you are struggling with linux commands and stuff and want something a little easier maybe have a look at installing webmin.  
Just search your distro and webmin “ubuntu webmin”.

The file manager in there is really easy to use and quick security is just to make it run on specific Ip addresses or local subnet which is also easy.

The bit you need is what either apache or nginx are serving and its in etc/apache/sites-available as your nextcloud app should be having those domains pop in.

---

<div class="post-metadata">

**Author:** ![Greg\_Fordyce](https://help.nextcloud.com/user_avatar/help.nextcloud.com/greg_fordyce/32/1947_2.png) [@Greg\_Fordyce](https://help.nextcloud.com/u/Greg_Fordyce)\
**Post date:** [January 12, 2017, 8:16am UTC](https://help.nextcloud.com/t/how-to-disable-you-are-accessing-the-server-from-an-untrusted-domain/4723/13 "2017-01-12T08:16:10Z")

</div>

Thanks Vincent\_Stans, I was going to try that last night but I managed to brick my install. I’ll try that tonight and report back.

---

<div class="post-metadata">

**Author:** ![Greg\_Fordyce](https://help.nextcloud.com/user_avatar/help.nextcloud.com/greg_fordyce/32/1947_2.png) [@Greg\_Fordyce](https://help.nextcloud.com/u/Greg_Fordyce)\
**Post date:** [January 12, 2017, 8:18am UTC](https://help.nextcloud.com/t/how-to-disable-you-are-accessing-the-server-from-an-untrusted-domain/4723/14 "2017-01-12T08:18:06Z")

</div>

I’ve thought about using webmin and might give it a go.

---

<div class="post-metadata">

**Author:** ![Greg\_Fordyce](https://help.nextcloud.com/user_avatar/help.nextcloud.com/greg_fordyce/32/1947_2.png) [@Greg\_Fordyce](https://help.nextcloud.com/u/Greg_Fordyce)\
**Post date:** [January 12, 2017, 9:37pm UTC](https://help.nextcloud.com/t/how-to-disable-you-are-accessing-the-server-from-an-untrusted-domain/4723/15 "2017-01-12T21:37:50Z")

</div>

Found it, on my NC Box the config.php file is found in 2 folders.

/var/snap/nextcloud/550/nextcloud/config/config.php  
/var/snap/nextcloud/136/nextcloud/config/config.php

---

<div class="post-metadata">

**Author:** ![clessley](https://help.nextcloud.com/user_avatar/help.nextcloud.com/clessley/32/3603_2.png) [@clessley](https://help.nextcloud.com/u/clessley)\
**Post date:** [April 5, 2017, 6:01pm UTC](https://help.nextcloud.com/t/how-to-disable-you-are-accessing-the-server-from-an-untrusted-domain/4723/16 "2017-04-05T18:01:29Z")

</div>

Snap install on encrypted Ubuntu MATE 16.04 64-bit using self signed cert with OTP inside Virtualbox v5.1.18 guest on Windows 7 32-bit host.

The config.php file was located for me at: /snap/nextcloud/1182/config/

Since the snap location is read only even for sudo/root, manually editing the config.php file isn’t possible. As I understand it, this is by Canonical snap design (and rightly so).

You can simply take the url:

`https://localhost/index.php/settings/admin?trustDomain=xxx.xxx.x.xxx`

and enter this from inside your local nextcloud browser, changing the xxx IP to whatever you need to be trusted.

The admin page will refresh and a little dialog will prompt to really trust the domain, select yes.

Back on your host OS, enter the IP of the nexcloud install as before; the untrusted domain warning page won’t appear. Amusingly in my particular setup the xxx IP is the same as the inet addr: using ifconfig command from within the linux guest.

---

<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:** [November 6, 2024, 8:41pm UTC](https://help.nextcloud.com/t/how-to-disable-you-are-accessing-the-server-from-an-untrusted-domain/4723/17 "2024-11-06T20:41:32Z")

</div>

wwe: close old topics

---

<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, 12:25pm UTC](https://help.nextcloud.com/t/how-to-disable-you-are-accessing-the-server-from-an-untrusted-domain/4723/18 "2024-12-09T12:25:22Z")

</div>


