WebSocket Connection Issues with OnlyOffice Document Server Behind IIS Reverse Proxy

We already have an entreprise license for the Document Server. Currently we are using v7.0.1 in our Production but now we are trying to upgrade our setup to the latest v9.4.1. We are trying to integrate this on another server running our staging environment and facing following issue connecting to the Document Server service.

Issue Description:

  • Browser console shows WebSocket connection failures: WebSocket connection to 'wss://docsprep.rlducm.com/9.4.1-gskjdgfhgfjhgdjhgfjhf/doc/-167700000/c/?shardkey=-167700000&EIO=4&transport=websocket' failed
  • No error messages appear in Network tab (status shows as “Finished” with empty Messages)
  • All static resources (including api.js) load correctly via HTTPS

Environment:

  • Windows Server 2025
  • OnlyOffice Document Server version: 9.4.1 (Windows installation)
  • Reverse Proxy: IIS 10.0 with Application Request Routing (ARR) 3.0 (version 7.1.05311.2309)
  • Setup: OnlyOffice running on localhost:5050, proxied through IIS with SSL termination at https://docsprep.rlducm.com

Current Configuration:

web.config:

<?xml version="1.0" encoding="UTF-8"?>
<configuration>
  <system.webServer>
    <webSocket enabled="true" />
    <rewrite>
      <rules>
        <rule name="INIT_SERVER_VARIABLE_FROM_PROXY" stopProcessing="false">
          <match url=".*" /> 
          <serverVariables>		  
            <set name="HTTP_THE_SCHEME" value="{HTTP_X_FORWARDED_PROTO}" replace="true" />			
            <set name="HTTP_THE_HOST" value="{HTTP_X_FORWARDED_HOST}" replace="true" />
          </serverVariables>
          <action type="None" />
        </rule>	
        <rule name="INIT_SERVER_VARIABLE_DEFAULT" stopProcessing="false">
          <match url=".*" /> 
          <conditions trackAllCaptures="true">
            <add input="{HTTPS}s" pattern="on(s)|offs" />
          </conditions>
          <serverVariables>		  
            <set name="HTTP_THE_SCHEME" value="http{C:1}" replace="false" />			
            <set name="HTTP_THE_HOST" value="{HTTP_HOST}" replace="false" />		
          </serverVariables>
          <action type="None" />
        </rule>	
        <rule name="DocumentServerRewrite" enabled="true">
          <match url="(.*)" />
          <conditions trackAllCaptures="true">
            <add input="{HTTPS}s" pattern="on(s)|offs" />
          </conditions>
          <serverVariables>              
            <set name="HTTP_X_FORWARDED_PROTO" value="{HTTP_THE_SCHEME}" replace="true" />
            <set name="HTTP_X_FORWARDED_HOST" value="{HTTP_THE_HOST}" replace="true" />
          </serverVariables>
          <action type="Rewrite" url="http://localhost:5050/{R:1}" />
        </rule>
      </rules>
    </rewrite>
  </system.webServer>
</configuration>

IIS Server Variables Registered:

  • HTTP_X_FORWARDED_PROTO
  • HTTP_X_FORWARDED_HOST
  • HTTP_THE_SCHEME
  • HTTP_THE_HOST

ARR Proxy Settings:

  • enabled: True
  • preserveHostHeader: True
  • reverseRewriteHostInResponseHeaders: True
  • httpVersion: PassThrough

What we’ve tried so far:

  1. Followed official OnlyOffice IIS proxy configuration from document-server-proxy/iis/proxy-to-virtual-path but modified it slightly because our installation is at the root of the site and not under a virtual path. We used following link for the IIS config: Official Github link to IIS reverse proxy setting
  2. Verified WebSocket protocol is installed on Windows Server.
  3. Registered all required IIS server variables for forwarded headers.
  4. Attempted to add dedicated WebSocket rewrite rules (caused api.js to fail with ERR_BLOCKED_BY_ORB)
1 Like

Hi @khurram.hassan, welcome to the Community! Since you have an Enterprise license for Document Server, I’d recommend reaching out to us via Zendesk (https://onlyofficesupport.zendesk.com/) so our team can look into the WebSocket/IIS ARR setup privately. That way you can share logs, configs, or screen recordings securely, which usually helps us resolve environment-specific issues like this faster.