Skip to content

Instantly share code, notes, and snippets.

@michaelbarkdoll
Created April 26, 2019 14:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save michaelbarkdoll/d78614635fa0432ab08100d05f1a4919 to your computer and use it in GitHub Desktop.
Save michaelbarkdoll/d78614635fa0432ab08100d05f1a4919 to your computer and use it in GitHub Desktop.
events {
}
http {
map $http_upgrade $connection_upgrade {
default upgrade;
'' close;
}
upstream websocket {
server 10.0.12.13:8080;
server 10.0.12.14:8080;
server 10.0.12.15:8080;
}
#https://docs.nginx.com/nginx/deployment-guides/node-js-load-balancing-nginx-plus/#websocket
upstream guacamoleservers {
# Clients with the same IP are redirected to the same backend
ip_hash;
server guacamole:8080;
server guacamole2:8080;
}
resolver 127.0.0.11 valid=10s;
server {
listen 80;
location /guacamole/ {
set $backend_servers guacamole;
proxy_pass http://guacamoleservers/guacamole/;
proxy_buffering off;
proxy_http_version 1.1;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection $connection_upgrade;
#proxy_set_header Connection "Upgrade";
access_log off;
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment