techblog

hass-nginx

Nov 4th, 2017
1,277
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Nginx 0.76 KB | None | 0 0
  1. server {
  2.     listen 80;
  3.     server_name hass.example.com;
  4.  
  5.     location / {
  6.         proxy_pass http://127.0.0.1:8123;
  7.         #proxy_set_header Host $host;
  8.         proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
  9.         proxy_set_header X-Forwarded-Proto $scheme;
  10.         # the next 3 lines are for cocket protocol nedded both for web ui and mobile app
  11.         proxy_http_version 1.1;
  12.         proxy_set_header Upgrade $http_upgrade;
  13.         proxy_set_header Connection "upgrade";
  14.     }
  15.      location /api/websocket {
  16.         proxy_pass http://127.0.0.1:8123/api/websocket;
  17.         proxy_set_header Host $host;
  18.  
  19.         proxy_http_version 1.1;
  20.         proxy_set_header Upgrade $http_upgrade;
  21.         proxy_set_header Connection "upgrade";
  22.  
  23.     }
  24. }
Advertisement
Add Comment
Please, Sign In to add comment