# Login fails on Subdomain but works on Domain

**URL:** <https://help.nextcloud.com/t/login-fails-on-subdomain-but-works-on-domain/249910>\
**Category:** ℹ️ Support\
**Tags:** hosting\
**Created:** [September 24, 2026, 1:36pm UTC](https://help.nextcloud.com/t/login-fails-on-subdomain-but-works-on-domain/249910 "2026-09-24T13:36:06Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![markus\_koller](https://help.nextcloud.com/user_avatar/help.nextcloud.com/markus_koller/32/80034_2.png) [@markus\_koller](https://help.nextcloud.com/u/markus_koller)\
**Post date:** [September 24, 2026, 1:36pm UTC](https://help.nextcloud.com/t/login-fails-on-subdomain-but-works-on-domain/249910/1 "2026-09-24T13:36:06Z")

</div>

> **Support intro**
>
> ## Sorry to hear you’re facing problems. 🙁
> 
> _The community help forum ([help.nextcloud.com](http://help.nextcloud.com)) is for home and non-enterprise users. Support is provided by other community members on a best effort / “as available” basis. All of those responding are **volunteering their time to help you.** _
> 
> **If you’re using Nextcloud in a business/critical setting, paid and SLA-based support services can be accessed via [portal.nextcloud.com](http://portal.nextcloud.com) where Nextcloud engineers can help ensure your business keeps running smoothly.**
> 
> ## Getting help
> 
> In order to help you as efficiently (and quickly!) as possible, please fill in as much of the below requested information as you can.
> 
> **Before clicking submit** : Please check if your query is already addressed via the following resources:
> 
> - [Official documentation](https://docs.nextcloud.com) (searchable and regularly updated)
> - [How to topics and FAQs](https://help.nextcloud.com/c/how-to-faqs/9)
> - [Forum search](https://help.nextcloud.com/search)
> 
> (Utilizing these existing resources is typically faster. It also helps reduce the load on our generous volunteers while elevating the signal to noise ratio of the forums otherwise arising from the same queries being posted repeatedly).

Hello,

i have an Issue logging in to Nextcloud and i hope someone here can help me…

## The Basics

- Nextcloud Server version _(e.g., 29.x.x)_:
  - `35.0.0.10`

- Operating system and version _(e.g., Ubuntu 24.04)_:
  - **Linux 6.12.107+deb13-amd64 x86\_64**

- Web server and version _(e.g, Apache 2.4.25)_:
  - `Apache 2.4.?`

- PHP version _(e.g, 8.3)_:
  - `8.5`

- Installation method _(e.g. AlO, NCP, Bare Metal/Archive, etc.)_
  - `WebInstaller from nextcloud website (setup-nextcloud.php) `

- Are you using CloudfIare, mod\_security, or similar? _(Yes / No)_
  - `NO`

### Summary of the issue you are facing:

I end up with a Login-loop when i call Nextcloud from a Subdomain sub.domain.tld  
When i use domain.tld everything works fine.  
There seems to be an Issue with the Session files when using Subdomains.  
The Browser (Chrome) Session is set correctly but as soon as i am redirected to /apps/dashboard a new Session is generated which leads back to the login page.

What is really strange for me is that when i leave the Tab with the login-page open for about 5-6 Minutes there is a good chance that the login works.

Log entries in nextcloud.log say “User not logged in”.

As soon i use a normal domain.tld everything works fine.  
I am in contact with my hosting company ([Hetzner.de](http://Hetzner.de)) but they do not give nextcloud support when it is installed on normal Webhosting - which is understandable

### Steps to replicate it (hint: details matter!):

1. Use a Subdomain to open Nextcloud - try to login with a valid user (disable remember me - leads to “Too many redirects”)

2. End up with a login loop

3. If i wait for about 5-6 Minutes i sometimes (6 out of 10) can log in on a subdomain

**CONFIG:**

```auto
> $CONFIG = array (
> 'instanceid' => 'xxxxxxxxxxxx',
> 'passwordsalt' => 'xxxxxxxxxxxxxxxxxxxxx',
> 'secret' => 'xxxxxxxxxxxxxxxxxxxxxxxxxxx',
> 'trusted_domains' => 
> array (
> 0 => 'cloud.xxxxxx.at',
> 1 => 'www.xxxxxx.at',
> 2 => 'xxxxxx.at',
> ),
> 'datadirectory' => '/usr/www/users/xxxxxx/cloudtest/data',
> 'dbtype' => 'pgsql',
> 'version' => '35.0.0.10',
> 'overwriteprotocol' => 'https',
> 'overwritehost' => 'cloud.xxxxxxx.at',
> 'overwrite.cli.url' => 'https://cloud.xxxxxxx.at',
> 'htaccess.RewriteBase' => '/',
> 'dbname' => 'xxxxxxxxxxx',
> 'dbhost' => 'xxxxxxxxxxxxxx',
> 'dbtableprefix' => 'oc\_',
> 'dbuser' => 'xxxxxxxxxxxxx',
> 'dbpassword' => 'xxxxxxxxxxxxxx',
> 'installed' => true,
> 'dbport' => 5432,
> 'loglevel' => 0,    
> );

```

**LOG:**

```auto
{"reqId":"arUrWxybgysYxhwiNBV7yAAAAAM","level":0,"time":"2026-09-24T13:53:31+00:00","user":"--","app":"dashboard","method":"GET","url":"/apps/dashboard/","message":"Current user is not logged in","exception":{"Exception":"OC\\AppFramework\\Middleware\\Security\\Exceptions\\NotLoggedInException","Message":"Current user is not logged in","Code":401}}

{"reqId":"arUrWxybgysYxhwiNBV7ygAAAAM","level":1,"time":"2026-09-24T13:53:31+00:00","user":"--","app":"no app in context","method":"GET","url":"/login?redirect_url=/apps/dashboard/","message":"The app config key dav/hide_absence_settings is not defined in the config lexicon"}

{"reqId":"arUrjhybgysYxhwiNBV8hQAAABg","level":0,"time":"2026-09-24T13:54:22+00:00","user":"admin","app":"no app in context","method":"GET","url":"/ocs/v2.php/apps/notifications/api/v2/notifications","message":"dirty table reads: SELECT `name` FROM `*PREFIX*authtoken` WHERE (`uid` = :dcValue1) AND (`last_activity` >= :dcValue2)"}

```

EDIT: added more Information

Thank you in advance

Regards Markus

---

<div class="post-metadata">

**Author:** ![JimmyKater](https://help.nextcloud.com/user_avatar/help.nextcloud.com/jimmykater/32/4850_2.png) [@JimmyKater](https://help.nextcloud.com/u/JimmyKater)\
**Post date:** [September 24, 2026, 1:46pm UTC](https://help.nextcloud.com/t/login-fails-on-subdomain-but-works-on-domain/249910/2 "2026-09-24T13:46:29Z")

</div>

@markus_koller  
hello and welcome to the beautiful world of the Nextcloud Community Forum.

Let me get that right. You used the webinstaller that Hetzner offers? or which webinstallier are you referring to?

Apart from that I would wish you would have filled in more details to our beloved [support template](https://help.nextcloud.com/t/support-template-please-use-this-when-you-request-support/137402).

Maybe it would even be helpful if you’d post your config.php (take care about all the sensitive data provided there)

---

<div class="post-metadata">

**Author:** ![markus\_koller](https://help.nextcloud.com/user_avatar/help.nextcloud.com/markus_koller/32/80034_2.png) [@markus\_koller](https://help.nextcloud.com/u/markus_koller)\
**Post date:** [September 24, 2026, 2:02pm UTC](https://help.nextcloud.com/t/login-fails-on-subdomain-but-works-on-domain/249910/3 "2026-09-24T14:02:57Z")

</div>

@JimmyKater - sorry for not providing enough Information…  
I used the setup Script that i downloaded from [Nextcloud downloaden und installieren](https://nextcloud.com/de/installation/#community-projects)  
I added the config.php Values and the nextcloud.log  
There are no errors in PHP or anywhere else.

Thank you!

---

<div class="post-metadata">

**Author:** ![JimmyKater](https://help.nextcloud.com/user_avatar/help.nextcloud.com/jimmykater/32/4850_2.png) [@JimmyKater](https://help.nextcloud.com/u/JimmyKater)\
**Post date:** [September 24, 2026, 2:17pm UTC](https://help.nextcloud.com/t/login-fails-on-subdomain-but-works-on-domain/249910/4 "2026-09-24T14:17:37Z")

</div>

this is a new installation, right?

so you’ll find me quite surprised because the webinstaller usually works perfectly (though I can’t test it right now).

are there, by any chance, still unsolved setup messages under your admin account?

have you checked your apache-setup? or nginx? caddy?

See - why I was asking for using the [support template](https://help.nextcloud.com/t/support-template-please-use-this-when-you-request-support/137402)? You cause more work to ppl trying to help by avoiding giving out more information about your setup and environment.

I need to ask openly: are you a kind of rookie in Linux? I mean - and I don’t want to sound impolite or insulting - do you know what to do and what needs to be done? Like a bare-metal installation of NC is no no-brainer, it needs to be maintained on a regular basis, etc. Just in case you’re a beginner maybe Nextcloud AIO would be the better choice for you?

---

<div class="post-metadata">

**Author:** ![markus\_koller](https://help.nextcloud.com/user_avatar/help.nextcloud.com/markus_koller/32/80034_2.png) [@markus\_koller](https://help.nextcloud.com/u/markus_koller)\
**Post date:** [September 24, 2026, 3:30pm UTC](https://help.nextcloud.com/t/login-fails-on-subdomain-but-works-on-domain/249910/5 "2026-09-24T15:30:04Z")

</div>

I am a Linux-rookie you are right! But you already lead me to the (my) solution…

I don´t know how or why but i deleted the database and all the files in the folder, reinstalled Nextcloud using latest.zip (not setup-nextcloud.php) - everything is working fine.  
I made no changes to my PHP-Settings or DB-Settings, used the same Folder and the same DB (deleted all Tables before).  
I did not even empty the browser cache or delete any cookies.

So all can say is thank you for your time and effort!  
If you prefer to delete the Topic - feel free to do it as it may not be useful to other members…

Sorry for the inconvenience!

Regards  
Markus

---

<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:** [October 2, 2026, 3:30pm UTC](https://help.nextcloud.com/t/login-fails-on-subdomain-but-works-on-domain/249910/6 "2026-10-02T15:30:52Z")

</div>

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