Add required access policy
Create a policy that's required to turn a connection into a WebSocket.
Add access policy for each web socket URI:
- For the web socket application navigate to the Policies tab.
- Click Add () in the policy list header and choose Protected. See Policy types.
- Enter the following:
Field Value Name An appropriate name for the policy such as WebSocket URI. Policy Type Protected Resource Path URL to the web socket (for example /path/to/ws1). - Expand Advanced.
- In the Custom Configuration text area enter the following code: proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection "upgrade";
- Click Not validated to validate the code block. After being successfully validated, the label changes to Valid.
- Correct any errors. Click Okay to finalize the policy.
- Repeat for each web socket URI
- Click Done to complete the application.
Related topics
See WebSocket proxying for more information on NGINX support for WebSockets.