I get an 404 after adding 4 lines in config.php, even after I removed them

Some some reason I get an 404 when I visit https://cloud.domain.net, that after I added 4 lines in the config.php, they have since been removed. But still a 404. I have no idea why at this point. Please help.

  nextcloud:
    image: lscr.io/linuxserver/nextcloud:latest
    container_name: nextcloud
    networks:
       - web
       - default
    environment:
      - PUID=1000
      - PGID=1000
      - TZ=${TZ}
      - MYSQL_DATABASE=${MYSQL_DB}
      - MYSQL_USER=${MYSQL_USER}
      - MYSQL_PASSWORD=${MYSQL_PW}
      - MYSQL_HOST=${MYSQL_HOST}
      - NEXTCLOUD_ADMIN_USER=${NEXTCLOUD_ADMIN}
      - NEXTCLOUD_ADMIN_PASSWORD=${NEXTCLOUD_ADMIN_PW}
      - REDIS_HOST=${REDIS_HOST}
      - REDIS_PORT=${REDIS_PORT}
      - REDIS_HOST_PASSWORD=${REDIS_PW}
    links:
      - mariadb
      - redis
    depends_on:
      - mariadb
      - redis
    volumes:
      - ./appdata/nextcloud:/config
      - /amsvartnir/nextcloudstorage/:/data
    #ports:
    #  - 8443:443
    restart: unless-stopped
    labels:
      - traefik.enable=true
      - traefik.http.routers.nextcloud.entrypoints=web
      - traefik.http.routers.nextcloud.rule=Host(`cloud.${DOMAIN}`)
      - traefik.http.middlewares.nextcloud-https-redirect.redirectscheme.scheme=https
      - traefik.http.middlewares.nextcloud.headers.framedeny=true
      - traefik.http.middlewares.nextcloud.headers.browserxssfilter=true
      - traefik.http.routers.nextcloud.middlewares=traefik-https-redirect
      - traefik.http.routers.nextcloud-secure.entrypoints=websecure
      - traefik.http.routers.nextcloud-secure.rule=Host(`cloud.${DOMAIN}`)
      - traefik.http.routers.nextcloud-secure.tls=true
      - traefik.http.routers.nextcloud-secure.service=nextcloud
      - traefik.http.routers.nextcloud.middlewares=nextcloud_redirectregex@docker
      - traefik.http.middlewares.nextcloud.redirectregex.redirectregex.permanent=true
      - traefik.http.middlewares.nextcloud_redirectregex.redirectregex.regex=https://(.*)/.well-known/(?:card|cal)dav
      - traefik.http.middlewares.nextcloud_redirectregex.redirectregex.replacement=https://$${1}/remote.php/dav
      - traefik.http.services.nextcloud.loadbalancer.server.port=80
Current traefik.yml:
entryPoints:
  web:
    address: ':80'
    http:
      redirections:
        entryPoint:
          to: websecure
          scheme: https
          permanent: true
  websecure:
    address: ':443'

api:
  dashboard: true
  debug: true

serversTransport:
  insecureSkipVerify: true

providers:
  docker:
    endpoint: 'unix:///var/run/docker.sock'
    exposedByDefault: false
    network: web
  file:
    directory: ./appdata/traefik/dynamic/
    watch: true

certificatesResolvers:
  cloudflare:
    acme:
      email: email@mail.net
      storage: acme.json
      dnsChallenge:
        provider: cloudflare
        resolvers:
          - '1.1.1.1:53'
          - '1.0.0.1:53'

log:
  level: "INFO"
  filePath: "/var/log/traefik/traefik.log"

accessLog:
  filePath: "/var/log/traefik/access.log"

Nextcloud config.php:

  <?php
  $CONFIG = array (
    'datadirectory' => '/data',
    'instanceid' => '*',
    'passwordsalt' => '*',
    'secret' => '*',
    'trusted_domains' =>
    array (
      0 => 'cloud.domain.net',
    ),
    'dbtype' => 'mysql',
    'version' => '30.0.5.1',
    'overwrite.cli.url' => 'https://cloud.domain.net',
    'dbname' => 'nextcloud',
    'dbhost' => 'mariadb:3306',
    'dbport' => '',
    'dbtableprefix' => 'oc_',
    'mysql.utf8mb4' => true,
    'dbuser' => 'nextcloud',
    'dbpassword' => '*',
    'installed' => true,
    'memcache.local' => '\\OC\\Memcache\\APCu',
    'filelocking.enabled' => true,
    'memcache.locking' => '\\OC\\Memcache\\APCu',
    'upgrade.disable-web' => true,
  );

Last three lines from the nextcloud log:

{"reqId":"yfZFuP14xexJkfr4nZvL","level":3,"time":"2025-01-20T09:00:04+00:00","remoteAddr":"","user":"--","app":"richdocuments","method":"","url":"--","message":"Failed to fetch discovery: Client error: `GET http://cloud.privetdrive.net/apps/richdocumentscode/proxy.php?req=/hosting/discovery` resulted in a `404 Not Found` response:\n<html>\r\n<head><title>404 Not Found</title></head>\r\n<body>\r\n<center><h1>404 Not Found</h1></center>\r\n<hr><center>nginx</c (truncated...)\n","userAgent":"--","version":"30.0.5.1","exception":{"Exception":"GuzzleHttp\\Exception\\ClientException","Message":"Client error: `GET http://cloud.privetdrive.net/apps/richdocumentscode/proxy.php?req=/hosting/discovery` resulted in a `404 Not Found` response:\n<html>\r\n<head><title>404 Not Found</title></head>\r\n<body>\r\n<center><h1>404 Not Found</h1></center>\r\n<hr><center>nginx</c (truncated...)\n","Code":404,"Trace":[{"file":"/app/www/public/3rdparty/guzzlehttp/guzzle/src/Middleware.php","line":72,"function":"create","class":"GuzzleHttp\\Exception\\RequestException","type":"::","args":["*** sensitive parameters replaced ***"]},{"file":"/app/www/public/3rdparty/guzzlehttp/promises/src/Promise.php","line":209,"function":"GuzzleHttp\\{closure}","class":"GuzzleHttp\\Middleware","type":"::","args":["*** sensitive parameters replaced ***"]},{"file":"/app/www/public/3rdparty/guzzlehttp/promises/src/Promise.php","line":158,"function":"callHandler","class":"GuzzleHttp\\Promise\\Promise","type":"::"},{"file":"/app/www/public/3rdparty/guzzlehttp/promises/src/TaskQueue.php","line":52,"function":"GuzzleHttp\\Promise\\{closure}","class":"GuzzleHttp\\Promise\\Promise","type":"::","args":["*** sensitive parameters replaced ***"]},{"file":"/app/www/public/3rdparty/guzzlehttp/promises/src/Promise.php","line":251,"function":"run","class":"GuzzleHttp\\Promise\\TaskQueue","type":"->"},{"file":"/app/www/public/3rdparty/guzzlehttp/promises/src/Promise.php","line":227,"function":"invokeWaitFn","class":"GuzzleHttp\\Promise\\Promise","type":"->"},{"file":"/app/www/public/3rdparty/guzzlehttp/promises/src/Promise.php","line":272,"function":"waitIfPending","class":"GuzzleHttp\\Promise\\Promise","type":"->"},{"file":"/app/www/public/3rdparty/guzzlehttp/promises/src/Promise.php","line":229,"function":"invokeWaitList","class":"GuzzleHttp\\Promise\\Promise","type":"->"},{"file":"/app/www/public/3rdparty/guzzlehttp/promises/src/Promise.php","line":69,"function":"waitIfPending","class":"GuzzleHttp\\Promise\\Promise","type":"->"},{"file":"/app/www/public/3rdparty/guzzlehttp/guzzle/src/Client.php","line":189,"function":"wait","class":"GuzzleHttp\\Promise\\Promise","type":"->"},{"file":"/app/www/public/lib/private/Http/Client/Client.php","line":205,"function":"request","class":"GuzzleHttp\\Client","type":"->"},{"file":"/config/www/nextcloud/apps/richdocuments/lib/Service/DiscoveryService.php","line":59,"function":"get","class":"OC\\Http\\Client\\Client","type":"->","args":["*** sensitive parameters replaced ***"]},{"file":"/config/www/nextcloud/apps/richdocuments/lib/Service/CachedRequestService.php","line":74,"function":"sendRequest","class":"OCA\\Richdocuments\\Service\\DiscoveryService","type":"->"},{"file":"/config/www/nextcloud/apps/richdocuments/lib/Backgroundjobs/ObtainCapabilities.php","line":41,"function":"fetch","class":"OCA\\Richdocuments\\Service\\CachedRequestService","type":"->"},{"file":"/app/www/public/lib/public/BackgroundJob/Job.php","line":61,"function":"run","class":"OCA\\Richdocuments\\Backgroundjobs\\ObtainCapabilities","type":"->"},{"file":"/app/www/public/lib/public/BackgroundJob/TimedJob.php","line":88,"function":"start","class":"OCP\\BackgroundJob\\Job","type":"->"},{"file":"/app/www/public/lib/public/BackgroundJob/TimedJob.php","line":75,"function":"start","class":"OCP\\BackgroundJob\\TimedJob","type":"->"},{"file":"/app/www/public/cron.php","line":162,"function":"execute","class":"OCP\\BackgroundJob\\TimedJob","type":"->"}],"File":"/app/www/public/3rdparty/guzzlehttp/guzzle/src/Exception/RequestException.php","Line":113,"message":"Failed to fetch discovery: Client error: `GET http://cloud.privetdrive.net/apps/richdocumentscode/proxy.php?req=/hosting/discovery` resulted in a `404 Not Found` response:\n<html>\r\n<head><title>404 Not Found</title></head>\r\n<body>\r\n<center><h1>404 Not Found</h1></center>\r\n<hr><center>nginx</c (truncated...)\n","exception":{},"CustomMessage":"Failed to fetch discovery: Client error: `GET http://cloud.privetdrive.net/apps/richdocumentscode/proxy.php?req=/hosting/discovery` resulted in a `404 Not Found` response:\n<html>\r\n<head><title>404 Not Found</title></head>\r\n<body>\r\n<center><h1>404 Not Found</h1></center>\r\n<hr><center>nginx</c (truncated...)\n"}}
{"reqId":"pcnkuvf6ZlluWQa1luvn","level":3,"time":"2025-01-20T10:05:03+00:00","remoteAddr":"","user":"--","app":"richdocuments","method":"","url":"--","message":"Failed to fetch capabilities: Client error: `GET http://cloud.privetdrive.net/apps/richdocumentscode/proxy.php?req=/hosting/capabilities` resulted in a `404 Not Found` response:\n404 page not found\n\n","userAgent":"--","version":"30.0.5.1","exception":{"Exception":"GuzzleHttp\\Exception\\ClientException","Message":"Client error: `GET http://cloud.privetdrive.net/apps/richdocumentscode/proxy.php?req=/hosting/capabilities` resulted in a `404 Not Found` response:\n404 page not found\n\n","Code":404,"Trace":[{"file":"/app/www/public/3rdparty/guzzlehttp/guzzle/src/Middleware.php","line":72,"function":"create","class":"GuzzleHttp\\Exception\\RequestException","type":"::","args":["*** sensitive parameters replaced ***"]},{"file":"/app/www/public/3rdparty/guzzlehttp/promises/src/Promise.php","line":209,"function":"GuzzleHttp\\{closure}","class":"GuzzleHttp\\Middleware","type":"::","args":["*** sensitive parameters replaced ***"]},{"file":"/app/www/public/3rdparty/guzzlehttp/promises/src/Promise.php","line":158,"function":"callHandler","class":"GuzzleHttp\\Promise\\Promise","type":"::"},{"file":"/app/www/public/3rdparty/guzzlehttp/promises/src/TaskQueue.php","line":52,"function":"GuzzleHttp\\Promise\\{closure}","class":"GuzzleHttp\\Promise\\Promise","type":"::","args":["*** sensitive parameters replaced ***"]},{"file":"/app/www/public/3rdparty/guzzlehttp/promises/src/Promise.php","line":251,"function":"run","class":"GuzzleHttp\\Promise\\TaskQueue","type":"->"},{"file":"/app/www/public/3rdparty/guzzlehttp/promises/src/Promise.php","line":227,"function":"invokeWaitFn","class":"GuzzleHttp\\Promise\\Promise","type":"->"},{"file":"/app/www/public/3rdparty/guzzlehttp/promises/src/Promise.php","line":272,"function":"waitIfPending","class":"GuzzleHttp\\Promise\\Promise","type":"->"},{"file":"/app/www/public/3rdparty/guzzlehttp/promises/src/Promise.php","line":229,"function":"invokeWaitList","class":"GuzzleHttp\\Promise\\Promise","type":"->"},{"file":"/app/www/public/3rdparty/guzzlehttp/promises/src/Promise.php","line":69,"function":"waitIfPending","class":"GuzzleHttp\\Promise\\Promise","type":"->"},{"file":"/app/www/public/3rdparty/guzzlehttp/guzzle/src/Client.php","line":189,"function":"wait","class":"GuzzleHttp\\Promise\\Promise","type":"->"},{"file":"/app/www/public/lib/private/Http/Client/Client.php","line":205,"function":"request","class":"GuzzleHttp\\Client","type":"->"},{"file":"/config/www/nextcloud/apps/richdocuments/lib/Service/CapabilitiesService.php","line":132,"function":"get","class":"OC\\Http\\Client\\Client","type":"->","args":["*** sensitive parameters replaced ***"]},{"file":"/config/www/nextcloud/apps/richdocuments/lib/Service/CachedRequestService.php","line":74,"function":"sendRequest","class":"OCA\\Richdocuments\\Service\\CapabilitiesService","type":"->"},{"file":"/config/www/nextcloud/apps/richdocuments/lib/Backgroundjobs/ObtainCapabilities.php","line":35,"function":"fetch","class":"OCA\\Richdocuments\\Service\\CachedRequestService","type":"->"},{"file":"/app/www/public/lib/public/BackgroundJob/Job.php","line":61,"function":"run","class":"OCA\\Richdocuments\\Backgroundjobs\\ObtainCapabilities","type":"->"},{"file":"/app/www/public/lib/public/BackgroundJob/TimedJob.php","line":88,"function":"start","class":"OCP\\BackgroundJob\\Job","type":"->"},{"file":"/app/www/public/lib/public/BackgroundJob/TimedJob.php","line":75,"function":"start","class":"OCP\\BackgroundJob\\TimedJob","type":"->"},{"file":"/app/www/public/cron.php","line":162,"function":"execute","class":"OCP\\BackgroundJob\\TimedJob","type":"->"}],"File":"/app/www/public/3rdparty/guzzlehttp/guzzle/src/Exception/RequestException.php","Line":113,"message":"Failed to fetch capabilities: Client error: `GET http://cloud.privetdrive.net/apps/richdocumentscode/proxy.php?req=/hosting/capabilities` resulted in a `404 Not Found` response:\n404 page not found\n\n","exception":{},"CustomMessage":"Failed to fetch capabilities: Client error: `GET http://cloud.privetdrive.net/apps/richdocumentscode/proxy.php?req=/hosting/capabilities` resulted in a `404 Not Found` response:\n404 page not found\n\n"}}
{"reqId":"pcnkuvf6ZlluWQa1luvn","level":3,"time":"2025-01-20T10:05:03+00:00","remoteAddr":"","user":"--","app":"richdocuments","method":"","url":"--","message":"Failed to fetch discovery: Client error: `GET http://cloud.privetdrive.net/apps/richdocumentscode/proxy.php?req=/hosting/discovery` resulted in a `404 Not Found` response:\n404 page not found\n\n","userAgent":"--","version":"30.0.5.1","exception":{"Exception":"GuzzleHttp\\Exception\\ClientException","Message":"Client error: `GET http://cloud.privetdrive.net/apps/richdocumentscode/proxy.php?req=/hosting/discovery` resulted in a `404 Not Found` response:\n404 page not found\n\n","Code":404,"Trace":[{"file":"/app/www/public/3rdparty/guzzlehttp/guzzle/src/Middleware.php","line":72,"function":"create","class":"GuzzleHttp\\Exception\\RequestException","type":"::","args":["*** sensitive parameters replaced ***"]},{"file":"/app/www/public/3rdparty/guzzlehttp/promises/src/Promise.php","line":209,"function":"GuzzleHttp\\{closure}","class":"GuzzleHttp\\Middleware","type":"::","args":["*** sensitive parameters replaced ***"]},{"file":"/app/www/public/3rdparty/guzzlehttp/promises/src/Promise.php","line":158,"function":"callHandler","class":"GuzzleHttp\\Promise\\Promise","type":"::"},{"file":"/app/www/public/3rdparty/guzzlehttp/promises/src/TaskQueue.php","line":52,"function":"GuzzleHttp\\Promise\\{closure}","class":"GuzzleHttp\\Promise\\Promise","type":"::","args":["*** sensitive parameters replaced ***"]},{"file":"/app/www/public/3rdparty/guzzlehttp/promises/src/Promise.php","line":251,"function":"run","class":"GuzzleHttp\\Promise\\TaskQueue","type":"->"},{"file":"/app/www/public/3rdparty/guzzlehttp/promises/src/Promise.php","line":227,"function":"invokeWaitFn","class":"GuzzleHttp\\Promise\\Promise","type":"->"},{"file":"/app/www/public/3rdparty/guzzlehttp/promises/src/Promise.php","line":272,"function":"waitIfPending","class":"GuzzleHttp\\Promise\\Promise","type":"->"},{"file":"/app/www/public/3rdparty/guzzlehttp/promises/src/Promise.php","line":229,"function":"invokeWaitList","class":"GuzzleHttp\\Promise\\Promise","type":"->"},{"file":"/app/www/public/3rdparty/guzzlehttp/promises/src/Promise.php","line":69,"function":"waitIfPending","class":"GuzzleHttp\\Promise\\Promise","type":"->"},{"file":"/app/www/public/3rdparty/guzzlehttp/guzzle/src/Client.php","line":189,"function":"wait","class":"GuzzleHttp\\Promise\\Promise","type":"->"},{"file":"/app/www/public/lib/private/Http/Client/Client.php","line":205,"function":"request","class":"GuzzleHttp\\Client","type":"->"},{"file":"/config/www/nextcloud/apps/richdocuments/lib/Service/DiscoveryService.php","line":59,"function":"get","class":"OC\\Http\\Client\\Client","type":"->","args":["*** sensitive parameters replaced ***"]},{"file":"/config/www/nextcloud/apps/richdocuments/lib/Service/CachedRequestService.php","line":74,"function":"sendRequest","class":"OCA\\Richdocuments\\Service\\DiscoveryService","type":"->"},{"file":"/config/www/nextcloud/apps/richdocuments/lib/Backgroundjobs/ObtainCapabilities.php","line":41,"function":"fetch","class":"OCA\\Richdocuments\\Service\\CachedRequestService","type":"->"},{"file":"/app/www/public/lib/public/BackgroundJob/Job.php","line":61,"function":"run","class":"OCA\\Richdocuments\\Backgroundjobs\\ObtainCapabilities","type":"->"},{"file":"/app/www/public/lib/public/BackgroundJob/TimedJob.php","line":88,"function":"start","class":"OCP\\BackgroundJob\\Job","type":"->"},{"file":"/app/www/public/lib/public/BackgroundJob/TimedJob.php","line":75,"function":"start","class":"OCP\\BackgroundJob\\TimedJob","type":"->"},{"file":"/app/www/public/cron.php","line":162,"function":"execute","class":"OCP\\BackgroundJob\\TimedJob","type":"->"}],"File":"/app/www/public/3rdparty/guzzlehttp/guzzle/src/Exception/RequestException.php","Line":113,"message":"Failed to fetch discovery: Client error: `GET http://cloud.privetdrive.net/apps/richdocumentscode/proxy.php?req=/hosting/discovery` resulted in a `404 Not Found` response:\n404 page not found\n\n","exception":{},"CustomMessage":"Failed to fetch discovery: Client error: `GET http://cloud.privetdrive.net/apps/richdocumentscode/proxy.php?req=/hosting/discovery` resulted in a `404 Not Found` response:\n404 page not found\n\n"}}

Hi Mattias_Hedman,

How annoying Nextcloud is not available!

You wrote quite a wall of text, with a lot of information. Could you try applying formatting, so that visitors can spend time trying to help you, instead of trying to find out what you wrote?

At the moment it is not easy to read which lines you added.

Just to be sure: after removing the lines, the file was saved in the right place, and the necessary services were restarted? And, of course: there was no 404 before adding these lines?

2 Likes

Formatting fixed. :slight_smile:

No, 404 before, the lines I added was:

  'trusted_proxies'   => ['10.1.1.10'], #IP is for the docker host
  'overwritehost'     => 'domain.net',
  'overwriteprotocol' => 'https',
  'overwritewebroot'  => 'cloud.domain.net',
  'overwritecondaddr' => '^10\.1\.1\.10$',
  'overwrite.cli.url' => 'https://cloud.domain.net/,

I should also add that the labels/Traefik part has followed me since Traefik v2. But as I said, there where no 404 before the adding of these lines. And it doesn’t removing them either. Still a 404.

1 Like

Thanks!

Could it be that these lines made Traefik chanhe the routing, which still persists now? I suspect you have more dockers running, are they all fine?

1 Like

Did you try to disable richdocumentscode app?
That app is throwing 404 errors.

You have changed some proxy and overwrite values.

This looks odd to me:

This directive is meant to add the webroot of your instance as needed from the outside world. I can not imagine, that that is:

https://cloud.domain.net/cloud.domain.net/

Please RE read the explantion in the config.sample.php!

That could be a cache issue but for me, when I try to reach your server, it looks like the 404 is coming from cloudflare.
Can you reach your server bypasing the cloudflare tunnel and proxies?

h.t.h.


Much and good luck,
ernolf

2 Likes

All other containesr are just fine working with their URLs :slight_smile:
Cache sounds like it could be. So make some changes as @ernolf saying and just chill for a while?

I am not using a cloudflare tunnel, I have turned off the cloudflare proxy to see if it works.
After disabling it there is no error anymore and no Nextcloud page either. It just spins and says it cannot find the server.

But now there is stuff in the nextcloud log:

nextcloud  | Exception: Not installed in /app/www/public/lib/base.php:223
nextcloud  | Stack trace:
nextcloud  | #0 /app/www/public/lib/base.php(668): OC::checkInstalled()
nextcloud  | #1 /app/www/public/lib/base.php(1134): OC::init()
nextcloud  | #2 /app/www/public/cron.php(24): require_once('...')
nextcloud  | #3 {main}
nextcloud  | Exception: Not installed in /app/www/public/lib/base.php:223
nextcloud  | Stack trace:
nextcloud  | #0 /app/www/public/lib/base.php(668): OC::checkInstalled()
nextcloud  | #1 /app/www/public/lib/base.php(1134): OC::init()
nextcloud  | #2 /app/www/public/cron.php(24): require_once('...')
nextcloud  | #3 {main}

Where did you find that richdocumentcode app? What app is causing that?

Oh ok - overwritewebroot if I have domain.net/nextcloud ?
I have as you have seen a subdomain so that is in essence not needed?