Server: Nextcloud 11 logout link broken behind reverse proxy

Created on 2 Jan 2017  路  6Comments  路  Source: nextcloud/server


I'm using Nextcloud 11 with apache2 behind an nginx reverse proxy and the logout link is broken.
Every other links are good from what i can tell, but logout link point to local ip:port not the domain i was contacting.

nextcloud_logout

Steps to reproduce

  1. Set up nextcloud behind a reverse proxy
  2. Log in
  3. Log out

Expected behaviour

We should get logged out

Actual behaviour

Invalid link, could not contact serverr

Server configuration

Operating system:
Debian Jessie
Web server:
apache2: 2.4.10-10+deb8u7
Database:
mariadb-server: 10.0.28-0+deb8u1
PHP version:
5.6.29+dfsg-0+deb8u1
Nextcloud version: (see Nextcloud admin page)
Nextcloud 11
Updated from an older Nextcloud/ownCloud or fresh install:
Updating consequently from 9 to 10 to 11
Where did you install Nextcloud from:

Signing status:


Signing status

No errors have been found.

List of activated apps:


App list

Enabled:
  - activity: 2.4.1
  - admin_audit: 1.1.0
  - calendar: 1.4.1
  - comments: 1.1.0
  - contacts: 1.5.2
  - dav: 1.1.1
  - federatedfilesharing: 1.1.1
  - federation: 1.1.1
  - files: 1.6.1
  - files_external: 1.1.2
  - files_pdfviewer: 1.0.1
  - files_sharing: 1.1.1
  - files_texteditor: 2.2
  - files_trashbin: 1.1.0
  - files_versions: 1.4.0
  - files_videoplayer: 1.0.0
  - gallery: 16.0.0
  - logreader: 2.0.0
  - lookup_server_connector: 1.0.0
  - nextcloud_announcements: 1.0
  - notes: 2.1.1
  - notifications: 1.0.1
  - password_policy: 1.1.0
  - provisioning_api: 1.1.0
  - serverinfo: 1.1.1
  - sharebymail: 1.0.1
  - survey_client: 0.1.5
  - systemtags: 1.1.3
  - templateeditor: 0.2
  - theming: 1.1.1
  - twofactor_backupcodes: 1.0.0
  - updatenotification: 1.1.1
  - user_external: 0.4
  - workflowengine: 1.1.1
Disabled:
  - encryption
  - external
  - files_accesscontrol
  - files_automatedtagging
  - files_retention
  - firstrunwizard
  - user_ldap
  - user_saml

The content of config/config.php:


Config report

{
    "system": {
        "instanceid": "ockw98is269v",
        "passwordsalt": "***REMOVED SENSITIVE VALUE***",
        "secret": "***REMOVED SENSITIVE VALUE***",
        "trusted_domains": [
            "127.0.0.1:8081"
        ],
        "datadirectory": "\/mnt\/DATA\/nextcloud\/data",
        "overwrite.cli.url": "http:\/\/127.0.0.1:8081",
        "dbtype": "mysql",
        "version": "11.0.0.10",
        "dbname": "nextcloud",
        "dbhost": "localhost",
        "dbtableprefix": "oc_",
        "dbuser": "***REMOVED SENSITIVE VALUE***",
        "dbpassword": "***REMOVED SENSITIVE VALUE***",
        "logtimezone": "UTC",
        "installed": true,
        "updater.server.url": "https:\/\/updates.nextcloud.com\/updater_server\/",
        "updater.release.channel": "stable",
        "maintenance": false,
        "theme": "",
        "loglevel": 2,
        "appstore.experimental.enabled": true
    }
}

Are you using external storage, if yes which one: local/smb/sftp/...
Yes, local
Are you using encryption: yes/no
I do not think so
Are you using an external user-backend, if yes which one: LDAP/ActiveDirectory/Webdav/...
No

Client configuration

Browser:
Chromium
Operating system:
Debian Jessie

Logs

Web server error log


Web server error log

Insert your webserver log here

Nextcloud log (data/nextcloud.log)


Nextcloud log

Insert your Nextcloud log here

Browser log


Browser log

Insert your browser log here, this could for example include:

a) The javascript console log
b) The network log
c) ...

needs info

Most helpful comment

Had same problem, in case someone is looking for solution, look for "overwritehost" here: https://docs.nextcloud.com/server/12/admin_manual/configuration_server/reverse_proxy_configuration.html

All 6 comments

Please fill out all missing information such as the config file etc.

Is this ok ?

        "trusted_domains": [
            "127.0.0.1:8081"
        ],
        "datadirectory": "\/mnt\/DATA\/nextcloud\/data",
        "overwrite.cli.url": "http:\/\/127.0.0.1:8081",

Please configure your instance properly to use a reverse proxy. See https://github.com/nextcloud/server/blob/fdf10e242d39d0bc4b4b7fef8ead5589c549763d/config/config.sample.php#L1235-L1252

Had same problem, in case someone is looking for solution, look for "overwritehost" here: https://docs.nextcloud.com/server/12/admin_manual/configuration_server/reverse_proxy_configuration.html

Still seeing this on NextCloud 12.0.3. Was able to get it working by adding the X-Forwarded-Host and X-Forwarded-Proto headers on the proxy.

Just chiming in for those coming in from search engines: @JamesonFinney's solution worked for me.

Have nextcloud 13 on an apache server behind an nginx proxy, and forwarding those headers solved the problem completely for me.

Was this page helpful?
0 / 5 - 0 ratings