Hi, thx for response.
I confirm the first trouble was to intercept and reverse correctly the wss request.
Totry to resolve it I set the reverse proxy conf as a copy of the local reverse proxy on the collabora machine. My server listen on 5246 port
This is my reverse proxy vhost:
<VirtualHost *:5246>
ProxyPreserveHost On
ProxyRequests Off
ServerName myservercollabora.domain.com
Options -Indexes
SSLProxyEngine on
SSLEngine on
SSLCertificateFile /path-to-certificate
SSLCertificateKeyFile /path-to-key
SSLCertificateChainFile /path-to-chain
SSLProtocol all -SSLv2 -SSLv3
SSLCipherSuite xxxxxxxx
SSLHonorCipherOrder on
AllowEncodedSlashes NoDecode
SSLProxyEngine On
SSLProxyVerify None
SSLProxyCheckPeerCN Off
SSLProxyCheckPeerName Off
ProxyPreserveHost On
ProxyPass /loleaflet https://myservercollabora.domain.com:5246/loleaflet retry=0
ProxyPassReverse /loleaflet https://myservercollabora.domain.com:5426/loleaflet
ProxyPass /hosting/discovery https://myservercollabora.domain.com:5426/hosting/discovery retry=0
ProxyPassReverse /hosting/discovery https://myservercollabora.domain.com:5426/hosting/discovery
ProxyPass /hosting/capabilities https://myservercollabora.domain.com:5426/hosting/capabilities retry=0
ProxyPassReverse /hosting/capabilities https://myservercollabora.domain.com:5426/hosting/capabilities
ProxyPassMatch "/lool/(.*)/ws$" wss://myservercollabora.domain.com:5426/lool/$1/ws nocanon
ProxyPass /lool/adminws wss://myservercollabora.domain.com:5246/lool/adminws
ProxyPass /lool https://myservercollabora.domain.com:5246/lool
ProxyPassReverse /lool https://myservercollabora.domain.com:5246/lool
also I see the log of the collabora enhence it to debug level, and see that when the user is inside the local network , the flow of collabora is different rather than when the user is out of the network.
This is an extract of the log when the user work internally:
wsd-03219-03224 2020-05-23 15:57:06.919887 [ accept_poll ] DBG Accepted socket #19, creating socket object.| net/Socket.cpp:642
wsd-03219-03224 2020-05-23 15:57:06.919982 [ accept_poll ] DBG #19 Thread affinity set to 0x7f23b3fff700.| ./net/Socket.hpp:325
wsd-03219-03224 2020-05-23 15:57:06.919997 [ accept_poll ] DBG StreamSocket ctor #19| ./net/Socket.hpp:784
wsd-03219-03224 2020-05-23 15:57:06.920009 [ accept_poll ] DBG SslStreamSocket ctor #19| ./net/SslSocket.hpp:30
wsd-03219-03224 2020-05-23 15:57:06.920055 [ accept_poll ] DBG Accepted socket has family 10 address ::ffff:127.0.0.1| net/Socket.cpp:669
wsd-03219-03224 2020-05-23 15:57:06.920067 [ accept_poll ] DBG Accepted client #19| net/ServerSocket.hpp:88
wsd-03219-03224 2020-05-23 15:57:06.920097 [ accept_poll ] DBG Inserting socket #19 into websrv_poll| ./net/Socket.hpp:626
wsd-03219-03224 2020-05-23 15:57:06.920107 [ accept_poll ] DBG #19 Thread affinity set to 0 (was 0x7f23b3fff700).| ./net/Socket.hpp:285
wsd-03219-03225 2020-05-23 15:57:06.920179 [ websrv_poll ] DBG #19 Thread affinity set to 0x7f23b37fe700 (was 0).| ./net/Socket.hpp:285
wsd-03219-03225 2020-05-23 15:57:06.924722 [ websrv_poll ] INF #19: Client HTTP Request: POST /loleaflet/6144a6c/loleaflet.html?WOPISrc=https%3A%2F%2Fnextcloudserver.domain.com%2Findex.php%2Fapps%2Frichdocuments%2Fwopi%2Ffiles%2F6470_ocrn105h6r4e&title=Andrea-4.odt&lang=en&closebutton=1&revisionhistory=1 HTTP/1.1 / Host: myservercollabora.domain.com:5246 / User-Agent: Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:76.0) Gecko/20100101 Firefox/76.0 / Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8 / Accept-Language: it-IT,it;q=0.8,en-US;q=0.5,en;q=0.3 / Accept-Encoding: gzip, deflate, br / Content-Type: application/x-www-form-urlencoded / Origin: null / Cookie: __Host-nc_sameSiteCookielax=true; __Host-nc_sameSiteCookiestrict=true / Upgrade-Insecure-Requests: 1 / X-Forwarded-For: 192.168.72.94 / X-Forwarded-Host: myservercollabora.domain.com:5246 / X-Forwarded-Server: myservercollabora.domain.com / Connection: Keep-Alive / Content-Length: 45| net/Socket.cpp:818
wsd-03219-03225 2020-05-23 15:57:06.924759 [ websrv_poll ] INF Handling request: /loleaflet/6144a6c/loleaflet.html?WOPISrc=https%3A%2F%2Fnextcloudserver.domain.com%2Findex.php%2Fapps%2Frichdocuments%2Fwopi%2Ffiles%2F6470_ocrn105h6r4e&title=Andrea-4.odt&lang=en&closebutton=1&revisionhistory=1| wsd/LOOLWSD.cpp:2245
wsd-03219-03225 2020-05-23 15:57:06.924867 [ websrv_poll ] DBG Preprocessing file: /loleaflet/dist/loleaflet.html| wsd/FileServer.cpp:704
wsd-03219-03225 2020-05-23 15:57:06.924921 [ websrv_poll ] INF WOPI host did not pass optional access_token_ttl| wsd/FileServer.cpp:737
wsd-03219-03225 2020-05-23 15:57:06.925121 [ websrv_poll ] DBG Captured cookies: __Host-nc_sameSiteCookielax=true:__Host-nc_sameSiteCookiestrict=true| wsd/FileServer.cpp:817
wsd-03219-03225 2020-05-23 15:57:06.925599 [ websrv_poll ] DBG Sent file: /loleaflet/dist/loleaflet.html:
And this is the same extract when the user is out of the network (internet)
wsd-03219-03224 2020-05-23 16:25:21.514728 [ accept_poll ] DBG Accepted socket #19, creating socket object.| net/Socket.cpp:642
wsd-03219-03224 2020-05-23 16:25:21.514840 [ accept_poll ] DBG #19 Thread affinity set to 0x7f23b3fff700.| ./net/Socket.hpp:325
wsd-03219-03224 2020-05-23 16:25:21.514855 [ accept_poll ] DBG StreamSocket ctor #19| ./net/Socket.hpp:784
wsd-03219-03224 2020-05-23 16:25:21.514871 [ accept_poll ] DBG SslStreamSocket ctor #19| ./net/SslSocket.hpp:30
wsd-03219-03224 2020-05-23 16:25:21.514913 [ accept_poll ] DBG Accepted socket has family 10 address ::ffff:127.0.0.1| net/Socket.cpp:669
wsd-03219-03224 2020-05-23 16:25:21.514924 [ accept_poll ] DBG Accepted client #19| net/ServerSocket.hpp:88
wsd-03219-03224 2020-05-23 16:25:21.514935 [ accept_poll ] DBG Inserting socket #19 into websrv_poll| ./net/Socket.hpp:626
wsd-03219-03224 2020-05-23 16:25:21.514946 [ accept_poll ] DBG #19 Thread affinity set to 0 (was 0x7f23b3fff700).| ./net/Socket.hpp:285
wsd-03219-03225 2020-05-23 16:25:21.515034 [ websrv_poll ] DBG #19 Thread affinity set to 0x7f23b37fe700 (was 0).| ./net/Socket.hpp:285
wsd-03219-03225 2020-05-23 16:25:21.519459 [ websrv_poll ] INF #19: Client HTTP Request: GET /hosting/discovery HTTP/1.1 / Host: myservercollabora.domain.com:5246 / User-Agent: Nextcloud Server Crawler / X-Forwarded-For: 192.168.61.100 / X-Forwarded-Host: myservercollabora.domain.com:5246 / X-Forwarded-Server: myservercollabora.domain.com / Connection: Keep-Alive| net/Socket.cpp:818
wsd-03219-03225 2020-05-23 16:25:21.519496 [ websrv_poll ] INF Handling request: /hosting/discovery| wsd/LOOLWSD.cpp:2245
wsd-03219-03225 2020-05-23 16:25:21.519514 [ websrv_poll ] DBG Wopi discovery request: /hosting/discovery| wsd/LOOLWSD.cpp:2500
wsd-03219-03225 2020-05-23 16:25:21.519960 [ websrv_poll ] INF Sent discovery.xml successfully.| wsd/LOOLWSD.cpp:2528
wsd-03219-03225 2020-05-23 16:25:21.519978 [ websrv_poll ] DBG SslStreamSocket::closeConnection() #19| ./net/SslSocket.hpp:77
wsd-03219-03225 2020-05-23 16:25:21.520010 [ websrv_poll ] DBG Removing socket #19 (of 1) from websrv_poll| net/Socket.cpp:316
wsd-03219-03225 2020-05-23 16:25:21.520023 [ websrv_poll ] DBG SslStreamSocket dtor #19| ./net/SslSocket.hpp:63
wsd-03219-03225 2020-05-23 16:25:21.520046 [ websrv_poll ] DBG StreamSocket dtor #19 with pending write: 0, read: 0| ./net/Socket.hpp:794
wsd-03219-03224 2020-05-23 16:25:22.296448 [ accept_poll ] DBG Accepted socket #19, creating socket object.| net/Socket.cpp:642
wsd-03219-03224 2020-05-23 16:25:22.296518 [ accept_poll ] DBG #19 Thread affinity set to 0x7f23b3fff700.| ./net/Socket.hpp:325
wsd-03219-03224 2020-05-23 16:25:22.296531 [ accept_poll ] DBG StreamSocket ctor #19| ./net/Socket.hpp:784
wsd-03219-03224 2020-05-23 16:25:22.296541 [ accept_poll ] DBG SslStreamSocket ctor #19| ./net/SslSocket.hpp:30
wsd-03219-03224 2020-05-23 16:25:22.296581 [ accept_poll ] DBG Accepted socket has family 10 address ::ffff:127.0.0.1| net/Socket.cpp:669
wsd-03219-03224 2020-05-23 16:25:22.296591 [ accept_poll ] DBG Accepted client #19| net/ServerSocket.hpp:88
wsd-03219-03224 2020-05-23 16:25:22.296601 [ accept_poll ] DBG Inserting socket #19 into websrv_poll| ./net/Socket.hpp:626
wsd-03219-03224 2020-05-23 16:25:22.296610 [ accept_poll ] DBG #19 Thread affinity set to 0 (was 0x7f23b3fff700).| ./net/Socket.hpp:285
wsd-03219-03225 2020-05-23 16:25:22.296676 [ websrv_poll ] DBG #19 Thread affinity set to 0x7f23b37fe700 (was 0).| ./net/Socket.hpp:285
wsd-03219-03225 2020-05-23 16:25:22.301146 [ websrv_poll ] INF #19: Client HTTP Request: POST /loleaflet/6144a6c/loleaflet.html?WOPISrc=https%3A%2F%2Fnextcloudserver.domain.com%2Findex.php%2Fapps%2Frichdocuments%2Fwopi%2Ffiles%2F6470_ocrn105h6r4e&title=Andrea-4.odt&lang=en&closebutton=1&revisionhistory=1 HTTP/1.1 / Host: myservercollabora.domain.com:5246 / User-Agent: Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:76.0) Gecko/20100101 Firefox/76.0 / Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8 / Accept-Language: it-IT,it;q=0.8,en-US;q=0.5,en;q=0.3 / Accept-Encoding: gzip, deflate, br / Content-Type: application/x-www-form-urlencoded / Origin: null / Cookie: __Host-nc_sameSiteCookielax=true; __Host-nc_sameSiteCookiestrict=true / Upgrade-Insecure-Requests: 1 / X-Forwarded-For: xx.xx.xx.xx, 192.168.61.100 / X-Forwarded-Host: myservercollabora.domain.com:5246, myservercollabora.domain.com:5246 / X-Forwarded-Server: myservercollabora.domain.com, myservercollabora.domain.com / Connection: Keep-Alive / Content-Length: 45| net/Socket.cpp:818
wsd-03219-03225 2020-05-23 16:25:22.301183 [ websrv_poll ] INF Handling request: /loleaflet/6144a6c/loleaflet.html?WOPISrc=https%3A%2F%2Fnextcloudserver.domain.com%2Findex.php%2Fapps%2Frichdocuments%2Fwopi%2Ffiles%2F6470_ocrn105h6r4e&title=Andrea-4.odt&lang=en&closebutton=1&revisionhistory=1| wsd/LOOLWSD.cpp:2245
wsd-03219-03225 2020-05-23 16:25:22.301286 [ websrv_poll ] DBG Preprocessing file: /loleaflet/dist/loleaflet.html| wsd/FileServer.cpp:704
wsd-03219-03225 2020-05-23 16:25:22.301368 [ websrv_poll ] INF WOPI host did not pass optional access_token_ttl| wsd/FileServer.cpp:737
wsd-03219-03225 2020-05-23 16:25:22.301558 [ websrv_poll ] DBG Captured cookies: __Host-nc_sameSiteCookielax=true:__Host-nc_sameSiteCookiestrict=true| wsd/FileServer.cpp:817
wsd-03219-03225 2020-05-23 16:25:22.301989 [ websrv_poll ] DBG Sent file: /loleaflet/dist/loleaflet.html:
Another point where the two logs flow are different is this:
For the user inside the local network (when the collabora is working)
wsd-03219-03224 2020-05-23 15:57:07.153557 [ accept_poll ] DBG #19 Thread affinity set to 0 (was 0x7f23b3fff700).| ./net/Socket.hpp:285
wsd-03219-03225 2020-05-23 15:57:07.153652 [ websrv_poll ] DBG #19 Thread affinity set to 0x7f23b37fe700 (was 0).| ./net/Socket.hpp:285
wsd-03219-03225 2020-05-23 15:57:07.158141 [ websrv_poll ] INF #19: Client HTTP Request: GET /lool/https%3A%2F%2Fnextcloudserver.domain.com%2Findex.php%2Fapps%2Frichdocuments%2Fwopi%2Ffiles%2F6470_ocrn105h6r4e%3Faccess_token%3DHSCnYZPN1KcMyawmPTtB98OVBFp5WEP8%26access_token_ttl%3D0/ws?WOPISrc=https%3A%2F%2Fnextcloudserver.domain.com%2Findex.php%2Fapps%2Frichdocuments%2Fwopi%2Ffiles%2F6470_ocrn105h6r4e&compat=/ws HTTP/1.1 / Host: myservercollabora.domain.com:5246 / User-Agent: Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:76.0) Gecko/20100101 Firefox/76.0 / Accept: */* / Accept-Language: it-IT,it;q=0.8,en-US;q=0.5,en;q=0.3 / Accept-Encoding: gzip, deflate, br / Sec-WebSocket-Version: 13 / Origin: https://myservercollabora.domain.com:5246 / Sec-WebSocket-Extensions: permessage-deflate / Sec-WebSocket-Key: TsxNIlBonlxcSbHEYcvCWQ== / Cookie: __Host-nc_sameSiteCookielax=true; __Host-nc_sameSiteCookiestrict=true / Pragma: no-cache / Cache-Control: no-cache / X-Forwarded-For: 192.168.72.94 / X-Forwarded-Host: myservercollabora.domain.com:5246 / X-Forwarded-Server: myservercollabora.domain.com / Upgrade: WebSocket / Connection: Upgrade| net/Socket.cpp:818
wsd-03219-03225 2020-05-23 15:57:07.158175 [ websrv_poll ] INF Handling request: /lool/https%3A%2F%2Fnextcloudserver.domain.com%2Findex.php%2Fapps%2Frichdocuments%2Fwopi%2Ffiles%2F6470_ocrn105h6r4e%3Faccess_token%3DHSCnYZPN1KcMyawmPTtB98OVBFp5WEP8%26access_token_ttl%3D0/ws?WOPISrc=https%3A%2F%2Fnextcloudserver.domain.com%2Findex.php%2Fapps%2Frichdocuments%2Fwopi%2Ffiles%2F6470_ocrn105h6r4e&compat=/ws| wsd/LOOLWSD.cpp:2245
wsd-03219-03225 2020-05-23 15:57:07.158219 [ websrv_poll ] INF #19: WebSocket version: 13, key: [TsxNIlBonlxcSbHEYcvCWQ==], protocol: [chat].| ./net/WebSocketHandler.hpp:718
wsd-03219-03225 2020-05-23 15:57:07.158285 [ websrv_poll ] INF URL [https://nextcloudserver.domain.com/index.php/apps/richdocuments/wopi/files/6470_ocrn105h6r4e?access_token=HSCnYZPN1KcMyawmPTtB98OVBFp5WEP8&access_token_ttl=0].| wsd/LOOLWSD.cpp:3050
wsd-03219-03225 2020-05-23 15:57:07.158308 [ websrv_poll ] INF URI [/index.php/apps/richdocuments/wopi/files/6470_ocrn105h6r4e].| wsd/LOOLWSD.cpp:3052
And for the user outside (when collabora with reverse proxy don’t work)
wsd-03219-03224 2020-05-23 16:25:22.582697 [ accept_poll ] DBG #19 Thread affinity set to 0 (was 0x7f23b3fff700).| ./net/Socket.hpp:285
wsd-03219-03225 2020-05-23 16:25:22.582788 [ websrv_poll ] DBG #19 Thread affinity set to 0x7f23b37fe700 (was 0).| ./net/Socket.hpp:285
wsd-03219-03225 2020-05-23 16:25:22.587393 [ websrv_poll ] INF #19: Client HTTP Request: GET /loleaflet/6144a6c/images/lc_view100_branding.svg HTTP/1.1 / Host: mycollaboraserver.domain.com:5246 / User-Agent: Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:76.0) Gecko/20100101 Firefox/76.0 / Accept: image/webp,*/* / Accept-Language: it-IT,it;q=0.8,en-US;q=0.5,en;q=0.3 / Accept-Encoding: gzip, deflate, br / Referer: https://mycollaboraserver.domain.com:5246/loleaflet/6144a6c/branding.css / Cookie: __Host-nc_sameSiteCookielax=true; __Host-nc_sameSiteCookiestrict=true / X-Forwarded-For: 95.245.215.138, 192.168.61.100 / X-Forwarded-Host: mycollaboraserver.domain.com:5246, mycollaboraserver.domain.com:5246 / X-Forwarded-Server: mycollaboraserver.domain.com, mycollaboraserver.domain.com / Connection: Keep-Alive| net/Socket.cpp:818
wsd-03219-03225 2020-05-23 16:25:22.587446 [ websrv_poll ] INF Handling request: /loleaflet/6144a6c/images/lc_view100_branding.svg| wsd/LOOLWSD.cpp:2245
wsd-03219-03225 2020-05-23 16:25:22.587693 [ websrv_poll ] DBG SslStreamSocket::closeConnection() #19| ./net/SslSocket.hpp:77
wsd-03219-03225 2020-05-23 16:25:22.587787 [ websrv_poll ] DBG Removing socket #19 (of 1) from websrv_poll| net/Socket.cpp:316
wsd-03219-03225 2020-05-23 16:25:22.587802 [ websrv_poll ] DBG SslStreamSocket dtor #19| ./net/SslSocket.hpp:63
wsd-03219-03225 2020-05-23 16:25:22.587828 [ websrv_poll ] DBG StreamSocket dtor #19 with pending write: 0, read: 0| ./net/Socket.hpp:794
wsd-03219-03224 2020-05-23 16:25:22.587850 [ accept_poll ] DBG Accepted socket #20, creating socket object.| net/Socket.cpp:642
wsd-03219-03224 2020-05-23 16:25:22.587888 [ accept_poll ] DBG #20 Thread affinity set to 0x7f23b3fff700.| ./net/Socket.hpp:325