Error message "Could not load photos folder" behind httpd reverse proxy šŸ™

Error message ā€œCould not load photos folderā€ behind httpd reverse proxy :frowning:

The Basics

  • Nextcloud Server version (e.g., 29.x.x):
    • 31.0.0.18
  • Operating system and version (e.g., Ubuntu 24.04):
    • Rocky Linux 9.5 (Blue Onyx)
  • Web server and version (e.g, Apache 2.4.25):
    • ā€œApache/2.4.62 (Rocky Linux)ā€
  • Reverse proxy and version _(e.g. nginx 1.27.2)
    • ā€œApache/2.4.62 (Rocky Linux)ā€
  • PHP version (e.g, 8.3):
    • PHP 8.2.27
  • Is this the first time youā€™ve seen this error? (Yes / No):
    • Yes and also via a 2nd setup
  • When did this problem seem to first start?
    • After installing the NC works fine, not any-more behind the proxy setup partially
  • Installation method (e.g. AlO, NCP, Bare Metal/Archive, etc.)
    • Inside LXCā€™s
  • Are you using CloudfIare, mod_security, or similar? (Yes / No)
    • No, the TLS-endpoint is in the reverse proxy

Summary of the issue you are facing:

Dear Support,

After login to the URI behind the very working reverse proxy setup I see the error message ā€œCould not load photos folderā€ and canā€™t view the photos.

firefox_cIi1p7rwoz

Yours nextcloud01,

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

  1. Setup a 2nd nextcloud server
  2. The message ā€œCould not load photos folderā€ keeps appearing with use of the login with a admin and a user account.

Log entries

Nextcloud

Please provide the log entries from your Nextcloud log that are generated during the time of problem (via the Copy raw option from Administration settings->Logging screen or from your nextcloud.log located in your data directory). Feel free to use a pastebin/gist service if necessary.

{
  "reqId": "Z8WMLJMNZqoAr4N72dm4XgAAAIw",
  "level": 3,
  "time": "2025-03-03T11:02:04+00:00",
  "remoteAddr": "ip_reverse_proxy",
  "user": "ncuser01",
  "app": "remote",
  "method": "PROPFIND",
  "url": "/nc/remote.phpp/dav/files/ncuser01/",
  "message": "Requested uri (/nc/remote.phpp/dav/files/ncuser01/) is out of base uri (/nc/remote.php/dav/)",
  "userAgent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:135.0) Gecko/20100101 Firefox/135.0",
  "version": "31.0.0.18",
  "exception": {
    "Exception": "Sabre\\DAV\\Exception\\Forbidden",
    "Message": "Requested uri (/nc/remote.phpp/dav/files/ncuser01/) is out of base uri (/nc/remote.php/dav/)",
    "Code": 0,
    "Trace": [
      {
        "file": "/var/www/html/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php",
        "line": 542,
        "function": "calculateUri",
        "class": "Sabre\\DAV\\Server",
        "type": "->"
      },
      {
        "file": "/var/www/html/nextcloud/apps/photos/lib/Listener/SabrePluginAuthInitListener.php",
        "line": 32,
        "function": "getRequestUri",
        "class": "Sabre\\DAV\\Server",
        "type": "->"
      },
      {
        "file": "/var/www/html/nextcloud/lib/private/EventDispatcher/ServiceEventListener.php",
        "line": 68,
        "function": "handle",
        "class": "OCA\\Photos\\Listener\\SabrePluginAuthInitListener",
        "type": "->"
      },
      {
        "file": "/var/www/html/nextcloud/3rdparty/symfony/event-dispatcher/EventDispatcher.php",
        "line": 220,
        "function": "__invoke",
        "class": "OC\\EventDispatcher\\ServiceEventListener",
        "type": "->"
      },
      {
        "file": "/var/www/html/nextcloud/3rdparty/symfony/event-dispatcher/EventDispatcher.php",
        "line": 56,
        "function": "callListeners",
        "class": "Symfony\\Component\\EventDispatcher\\EventDispatcher",
        "type": "->"
      },
      {
        "file": "/var/www/html/nextcloud/lib/private/EventDispatcher/EventDispatcher.php",
        "line": 67,
        "function": "dispatch",
        "class": "Symfony\\Component\\EventDispatcher\\EventDispatcher",
        "type": "->"
      },
      {
        "file": "/var/www/html/nextcloud/lib/private/EventDispatcher/EventDispatcher.php",
        "line": 79,
        "function": "dispatch",
        "class": "OC\\EventDispatcher\\EventDispatcher",
        "type": "->"
      },
      {
        "file": "/var/www/html/nextcloud/apps/dav/lib/Server.php",
        "line": 143,
        "function": "dispatchTyped",
        "class": "OC\\EventDispatcher\\EventDispatcher",
        "type": "->"
      },
      {
        "file": "/var/www/html/nextcloud/apps/dav/appinfo/v2/remote.php",
        "line": 20,
        "function": "__construct",
        "class": "OCA\\DAV\\Server",
        "type": "->"
      },
      {
        "file": "/var/www/html/nextcloud/remote.php",
        "line": 145,
        "args": [
          "/var/www/html/nextcloud/apps/dav/appinfo/v2/remote.php"
        ],
        "function": "require_once"
      }
    ],
    "File": "/var/www/html/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php",
    "Line": 576,
    "message": "Requested uri (/nc/remote.phpp/dav/files/ncuser01/) is out of base uri (/nc/remote.php/dav/)",
    "exception": {},
    "CustomMessage": "Requested uri (/nc/remote.phpp/dav/files/ncuser01/) is out of base uri (/nc/remote.php/dav/)"
  }
}

Web Browser

If the problem is related to the Web interface, open your browser inspector Console and Network tabs while refreshing (reloading) and reproducing the problem. Provide any relevant output/errors here that appear.

NS_ERROR_NOT_AVAILABLE: 

Web server / Reverse Proxy

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

No errors in logging of the server and the reverse proxy server.

Configuration

Nextcloud

The output of occ config:list system or similar is best, but, if not possible, the contents of your config.php file from /path/to/nextcloud is fine (make sure to remove any identifiable information!):

{
    "system": {
        "instanceid": "***REMOVED SENSITIVE VALUE***",
        "passwordsalt": "***REMOVED SENSITIVE VALUE***",
        "secret": "***REMOVED SENSITIVE VALUE***",
        "trusted_domains": [
            "ip_on_eth0",
            "ip_proxy_server",
            "my.tld"
        ],
        "datadirectory": "***REMOVED SENSITIVE VALUE***",
        "dbtype": "mysql",
        "version": "31.0.0.18",
        "overwrite.cli.url": "http:\/\/my.tld\/nc",
        "overwritehost": "my.tld",
        "overwritewebroot": "\/nc",
        "dbname": "***REMOVED SENSITIVE VALUE***",
        "dbhost": "***REMOVED SENSITIVE VALUE***",
        "dbport": "",
        "dbtableprefix": "oc_",
        "mysql.utf8mb4": true,
        "dbuser": "***REMOVED SENSITIVE VALUE***",
        "dbpassword": "***REMOVED SENSITIVE VALUE***",
        "installed": true,
        "maintenance": false
    }
}

Apps

The output of occ app:list (if possible).

Enabled:
  - activity: 4.0.0
  - app_api: 5.0.2
  - bruteforcesettings: 4.0.0
  - circles: 31.0.0-dev.0
  - cloud_federation_api: 1.14.0
  - comments: 1.21.0
  - contactsinteraction: 1.12.0
  - dashboard: 7.11.0
  - dav: 1.33.0
  - federatedfilesharing: 1.21.0
  - federation: 1.21.0
  - files: 2.3.1
  - files_downloadlimit: 4.0.0
  - files_pdfviewer: 4.0.0
  - files_reminders: 1.4.0
  - files_sharing: 1.23.1
  - files_trashbin: 1.21.0
  - files_versions: 1.24.0
  - firstrunwizard: 4.0.0
  - logreader: 4.0.0
  - lookup_server_connector: 1.19.0
  - nextcloud_announcements: 3.0.0
  - notifications: 4.0.0
  - oauth2: 1.19.1
  - password_policy: 3.0.0
  - photos: 4.0.0-dev.1
  - privacy: 3.0.0
  - profile: 1.0.0
  - provisioning_api: 1.21.0
  - recommendations: 4.0.0
  - related_resources: 2.0.0
  - serverinfo: 3.0.0
  - settings: 1.14.0
  - sharebymail: 1.21.0
  - support: 3.0.0
  - survey_client: 3.0.0
  - systemtags: 1.21.1
  - text: 5.0.0
  - theming: 2.6.1
  - twofactor_backupcodes: 1.20.0
  - updatenotification: 1.21.0
  - user_status: 1.11.0
  - viewer: 4.0.0
  - weather_status: 1.11.0
  - webhook_listeners: 1.2.0
  - workflowengine: 2.13.0
Disabled:
  - admin_audit: 1.21.0
  - encryption: 2.19.0
  - files_external: 1.23.0
  - suspicious_login: 9.0.1
  - twofactor_nextcloud_notification: 5.0.0
  - twofactor_totp: 13.0.0-dev.0
  - user_ldap: 1.22.0

Itā€™s a config matter on your RP. Should be easy to fix once you spot it.

e.g. See Nextcloud behind Apache reverse proxy, remote.php becomes remote.phpp

I have the same problem and I cant read/write to the databaseā€¦

creat a Table (like calendar) is no Problem ā€¦ but I cant use the tablesā€¦

Did you find a solution?

Yours

Dear Support,

The trailing forward slash ā€œ/ā€ is removed in my httpd RP config and that resolves the issue :grinning: :slightly_smiling_face:

1 Like

Even the following directives are not needed in my setup

        "overwrite.cli.url": "http:\/\/my.tld\/nc",
        "overwritehost": "my.tld",

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