about summary refs log tree commit diff
diff options
context:
space:
mode:
authorPaweł Dybiec <pawel.to.malpa@gmail.com>2019-04-24 17:54:09 +0200
committerPaweł Dybiec <pawel.to.malpa@gmail.com>2019-04-24 17:54:09 +0200
commitca572e1f5304aeba3daf6e32fe6a6522d25a5e83 (patch)
treea17f424846bf197b54ed3523f60877a002b5a3b5
parentdisable registration (diff)
Add config for websockets
-rw-r--r--domains.yml1
-rw-r--r--templates/nginx.conf.j24
2 files changed, 5 insertions, 0 deletions
diff --git a/domains.yml b/domains.yml
index 79e8ef4..38360c6 100644
--- a/domains.yml
+++ b/domains.yml
@@ -29,6 +29,7 @@ domains:
   octoprint:
     name: "octoprint.dybiec.info"
     http_redirect: true
+    websocket: true
     proxy:
       host: "192.168.255.6"
 
diff --git a/templates/nginx.conf.j2 b/templates/nginx.conf.j2
index 69b8d36..f12b11c 100644
--- a/templates/nginx.conf.j2
+++ b/templates/nginx.conf.j2
@@ -26,6 +26,10 @@ server {
     proxy_set_header  X-Forwarded-Proto $scheme;
     proxy_redirect off;
     proxy_http_version 1.1;
+{% if server.websocket is defined and server.websocket %}
+    proxy_set_header Upgrade $http_upgrade;
+    proxy_set_header Connection "Upgrade";
+{% endif %}
     {% endif %}
   }