Skip to content

Additional information needed for apps using SignalR/WebSocket #12774

Open

Description

@AlbertoPa

When Apache is used as proxy for apps relying on WebSocket:

  • The mod_proxy_wstunnel module needs to be enabled
  • The virtual host configuration needs to include additional settings to allow the WebSocket connection to be established. The example at the top of the page becomes something like:
<VirtualHost *:*>
    RequestHeader set "X-Forwarded-Proto" expr=%{REQUEST_SCHEME}
</VirtualHost>

<VirtualHost *:80>
    ProxyPreserveHost On
    ProxyPass / http://127.0.0.1:5000/
    ProxyPassReverse / http://127.0.0.1:5000/
    ServerName www.example.com
    ServerAlias *.example.com

    # Added block
    RewriteEngine On
    RewriteCond %{HTTP:Upgrade} =websocket [NC]
    RewriteRule /(.*)           ws://127.0.0.1:5000/$1 [P,L]
    RewriteCond %{HTTP:Upgrade} !=websocket [NC]
    RewriteRule /(.*)           http://127.0.0.1:5000/$1 [P,L]
    # End added block

    ErrorLog ${APACHE_LOG_DIR}helloapp-error.log
    CustomLog ${APACHE_LOG_DIR}helloapp-access.log common
</VirtualHost>

Thanks!


Document Details

⚠ Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.

Activity

  1. added
    Source - Docs.ms
    on Jun 10, 2019
  2. changed the title [-]Additional information need for apps using SignalR/WebSocket[/-] [+]Additional information needed for apps using SignalR/WebSocket[/+] on Jun 10, 2019
  3. guardrex commented on Jun 10, 2019

    @guardrex
    Collaborator

    Thanks @AlbertoPa ... I'll mark this for the Product Unit (PU label) to take a look at for coverage. They'll either work it directly on the next engineering doc sweep or give me instructions on what to cover where. Thanks for opening the issue.

  4. added this to the Backlog milestone on Jun 10, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    SignalRSource - Docs.msdoc-enhancement

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions