[SOLVED] https://sub.domain.org/nextcloud/index.php/login Not Found

Support intro

Sorry to hear you’re facing problems :slightly_frowning_face:

help.nextcloud.com is for home/non-enterprise users. If you’re running a business, paid support can be accessed via portal.nextcloud.com where we can ensure your business keeps running smoothly.

In order to help you as quickly as possible, before clicking Create Topic please provide as much of the below as you can. Feel free to use a pastebin service for logs, otherwise either indent short log examples with four spaces:


Or for longer, use three backticks above and below the code snippet:


Some or all of the below information will be requested if it isn’t supplied; for fastest response please provide as much as you can :heart:

Nextcloud version (eg, 20.0.5): 25.0.3
Operating system and version (eg, Ubuntu 20.04): AlmaLinux 8.7
Apache or nginx version (eg, Apache 2.4.25): Apache/2.4.37 (AlmaLinux)
PHP version (eg, 7.4): PHP 7.4.30

The issue you are facing:
I am self-hosting Nextcloud on a web server on my LAN. I have a separate server running Nginx Proxy Manager pointing at my web server. When accessing https://sub.domain.org/ it redirects to /nextcloud/index.php/login and gives an error:

Not Found

The requested URL was not found on this server.

However, on my LAN accessing http://ipaddress/nextcloud I am able to login with no issues.

The NPM configuration:

Details Tab:
Domain Names: sub.domain.org
Scheme: http
Forward: web_server_IP_address
Forward Port: 80

Custom locations Tab:
location: /
Scheme: http
Forward: web_server_IP_address/nextcloud/
Forward Port: 80

SSL Tab:
sub.domain.org certificate is selected. Force SSL is also selected

Is this the first time you’ve seen this error? (Y/N): Y (for the public domain name)

Steps to replicate it:

  1. enter https://sub.domain.org

The output of your Nextcloud log in Admin > Logging:


The output of your config.php file in /path/to/nextcloud (make sure you remove any identifiable information!):

$CONFIG = array (
  'instanceid' => 'x',
  'passwordsalt' => 'x',
  'secret' => 'x',
  'trusted_proxies' => ['NPM_IP_address'],
  'trusted_domains' =>
  array (
    0 => 'server_hostname',
    1 => 'server_IP_address',
    2 => 'sub.domain.org',
  'datadirectory' => '/path/to/data',
  'dbtype' => 'mysql',
  'version' => '',
  'overwrite.cli.url' => 'http://server_hostname/nextcloud',
  'dbname' => 'nextclouddb_name',
  'dbhost' => 'localhost',
  'dbport' => '',
  'dbtableprefix' => 'oc_',
  'mysql.utf8mb4' => true,
  'dbuser' => 'nextclouddb_username',
  'dbpassword' => 'blahblah_Im_not_telling',
  'installed' => true,

The output of your Apache/nginx/system log in /var/log/____:



Output errors in nextcloud.log in /var/www/ or as admin user in top right menu, filtering for errors. Use a pastebin service if necessary.


Anyone have any idea of the issue?

Playing around with all the entries for config.php I finally found the solution. I had to add this:

‘overwritewebroot’ => ‘/’

1 Like