Make Nextcloud, Collabora work with Traefik 3.6.4

Support intro

Sorry to hear you’re facing problems. :slightly_frowning_face:

The community help forum (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 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:

(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).

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:

The Basics

  • Nextcloud Server version (e.g., 29.x.x):
    • 32.0.2, 31.0.x
  • Operating system and version (e.g., Ubuntu 24.04):
    • Ubuntu 24.04
  • Web server and version (e.g, Apache 2.4.25):
    *
  • Reverse proxy and version _(e.g. nginx 1.27.2)
    • Traefik 3.6.4
  • When did this problem seem to first start?
    • When updating to Traefik 3.6.4
  • Installation method (e.g. AlO, NCP, Bare Metal/Archive, etc.)
    • Docker
  • Are you using CloudfIare, mod_security, or similar? (Yes / No)
    • no

Summary of the issue you are facing:

When updating Traefik to 3.6.4, I saw when opening a document in Nextcloud office

*Laden des Dokuments fehlgeschlagen.

Socket-Verbindung konnte nicht hergestellt werden oder Socket-Verbindung wurde unerwartet geschlossen. Der Reverse-Proxy ist möglicherweise falsch konfiguriert. Bitte wenden Sie sich an den Administrator. Weitere Informationen zur Proxy-Konfiguration finden Sie unter https://sdk.collaboraonline.com/docs/installation/Proxy_settings.html*

Failed to load the document.

Could not establish a socket connection, or the socket connection was unexpectedly closed. The reverse proxy may be configured incorrectly. Please contact your administrator. For more information on proxy configuration, see https://sdk.collaboraonline.com/docs/installation/Proxy_settings.html.

I found a lot of Error 400 messages in the browser networking console.

After a lot of searching I found out that the Traefik update was to blame.
A downgrade fixed it.

After more searching I found Traefik Migration Documentation - Traefik , and how to fix it for the current and future versions.

I needed to add the following encodedCharacters blocks to my traefik.yml:

entryPoints:
  http:
    address: ":80"

  https:
    address: ":443"
    http:
      encodedCharacters:
        allowEncodedSlash: true
        allowEncodedBackSlash: true
        allowEncodedNullCharacter: false
        allowEncodedSemicolon: false
        allowEncodedPercent: true
        allowEncodedQuestionMark: true
        allowEncodedHash: false

The problem is solved.
This is more meant as a how-to.

4 Likes

Oh, it turned out that the filter of the user list by group was also throwing Error 400 when clicking a group.
I have modified my post above.

Thanks @mklemme. I had the same issue and your solution works perfectly. I just removed the lines with false as this is their default value.

I played around hours in traefik settings. This fixed the issue, thank you soo much

Same here. thx for the solution!

many thanks for the write-up. I hit the issue with core files app navigating a folder with # in the name. Nextcloud complained the folder doesn’t exists and I was already :anxious_face_with_sweat: as it was a folder with my family pictures archive - but fortunately I remember this discussion and also the traefik github discussions..

tldr

  1. if you have folders with # in the name
  2. use
    #endpoint name
    web-secure:
      encodedCharacters:
        allowEncodedHash: true

conclusion: at the end “security improvement” from upstream breaks lot of things :frowning: