Nginx

From Piszczynski
Revision as of 22:32, 15 November 2023 by Aleks (talk | contribs) (1 revision imported)

Add Websocket to Nginx Proxy

Add the following in config file:

upstream websocket {

  server <ipaddress of server to proxy to>:<port number>;

}



 # Websocket location block

  

  location /<location of service on webserver> {

    proxy_pass https://websocket;

    proxy_http_version 1.1;

    proxy_set_header Upgrade $http_upgrade;

    proxy_set_header Connection "upgrade";

    proxy_set_header Host $host;

    }