From c67a39982e65a1c60d0f829e874a0c2ba24c137f Mon Sep 17 00:00:00 2001 From: Kris Lamoureux Date: Tue, 6 Dec 2022 00:15:10 -0500 Subject: [PATCH] Option to enable websockets for the noVNC console --- .gitignore | 10 ---------- roles/proxy/templates/server-nginx.conf.j2 | 6 ++++++ 2 files changed, 6 insertions(+), 10 deletions(-) diff --git a/.gitignore b/.gitignore index 6d9c91e..dd6f0e7 100644 --- a/.gitignore +++ b/.gitignore @@ -1,13 +1,3 @@ .vagrant .playbook -/*.yml -/*.yaml -!backup.yml -!moxie.yml -!docker.yml -!dockerbox.yml -!hypervisor.yml -!minecraft.yml -!proxy.yml -!unifi.yml /environments/ diff --git a/roles/proxy/templates/server-nginx.conf.j2 b/roles/proxy/templates/server-nginx.conf.j2 index 66684f8..a1d955e 100644 --- a/roles/proxy/templates/server-nginx.conf.j2 +++ b/roles/proxy/templates/server-nginx.conf.j2 @@ -46,6 +46,12 @@ server { proxy_pass {{ item.proxy_pass }}; {% if item.proxy_ssl_verify is defined and item.proxy_ssl_verify is false %} proxy_ssl_verify off; +{% endif %} +{% if item.websockets is defined and item.websockets %} + proxy_http_version 1.1; + proxy_set_header Connection $http_connection; + proxy_set_header Origin http://$host; + proxy_set_header Upgrade $http_upgrade; {% endif %} } }