Skip to content

Instantly share code, notes, and snippets.

@memandip
Last active July 26, 2019 08:50
Show Gist options
  • Save memandip/6a7df0d6926f2d75b23efce2392dec34 to your computer and use it in GitHub Desktop.
Save memandip/6a7df0d6926f2d75b23efce2392dec34 to your computer and use it in GitHub Desktop.
Nginx configuration to configure reverse proxy for websocket
server {
root projectDirectory;
# example root /var/www/html/myAwesomeProject/public;
index index.html;
server_name domain_name;
location /chat/socket {
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_pass "ws_url";
# example: proxy_pass "https://localhost:8080/chat/socket";
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment