Add required access policy

During this task we will create the required policy to turn a connection into a WebSocket.

Add access policy for each web socket URI:

  1. For the web socket application navigate to the Policies tab.
  2. Click Add () in the policy list header and choose Protected.

    See About Access Gateway policy types for more information on policy types.
    The Add New Policy pane will open at the bottom of the screen.
  3. Enter the following:
    FieldValue
    NameAn appropriate name for the policy such as WebSocket URI.
    Policy TypeProtected
    Resource PathURL to the web socket.
    For example /path/to/ws1.
  4. Expand Advanced.
  5. In the Custom Configuration text area enter the following code:
    Enter the following policy:
    proxy_set_header Upgrade $http_upgrade;
    proxy_set_header Connection "upgrade";
    

  6. Click Not validated to validate the code block.
    On success the Not validated button will become Valid.
  7. Correct any errors and click Okay to finalize the policy.
  8. Repeat for each web socket URI
  9. Click Done to complete the application.

Related topics

For more information on NGINX support for WebSocket proxying see http://nginx.org/en/docs/http/websocket.html.

Next steps

Test