DocumentServer icon indicating copy to clipboard operation
DocumentServer copied to clipboard

documentserver behind the proxy, virtualpath config

Open sacesare opened this issue 2 years ago • 1 comments

This issue is unique.

  • [X] I have used the search tool and did not find an issue describing my bug.

Operating System of DocumentServer

Docker

Version information

7.3

Expected Behavior

It used to work for 7.2 version of server, but since 7.3 I get "double" path resolution. It's related to handling "x-forwarded-host", "x-forwarded-prefix" headers. According to docs, I need to include "prefix" part in "x-forwarded-host" header. But, then getBaseUrl code will be not correct, because of unconditional "x-forwarded-prefix" append. So, we have "double" documentserver-virtual-path. By the way, it seems that that's not single method used for base url resolution, and if I set "x-forwarded-host" to host only and virtual path in "x-forwarded-prefix" part, it dosen't work either- I get url without virtual path prefix at document loading stage. So, I need to force "x-forwarded-prefix" header to be empty, leaving "x-forwarded-host" header with virtual path "prefix" part. Why? Don't know exactly, traefik's stripprefix middleware add removed virtual path to "x-forwarded-prefix" header automatically and it seems onlyoffice must work as expected with plain "x-forwarded-host" header (without virtual path part), but it dosen't. x-forwarded-prefix="/prefix" with x-forwarded-host="host" not working too, so only working solution is x-forwarded-host="host/prefix" and "x-forwarded-prefix"="".

Actual Behavior

Double virtual path resolution.

Reproduction Steps

No response

Additional information

No response

sacesare avatar Mar 13 '23 18:03 sacesare