forked from raveberry/raveberry
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathraveberry-remote
51 lines (46 loc) · 1.12 KB
/
raveberry-remote
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
server {
listen 80;
listen [::]:80;
server_tokens off;
# gzip compression is optional, but recommended
gzip on;
gzip_vary on;
gzip_proxied any;
gzip_comp_level 6;
gzip_min_length 256;
gzip_types
text/plain
text/css
text/js
text/xml
text/javascript
application/javascript
application/x-javascript
application/json
application/xml
application/rss+xml
image/svg+xml/javascript;
location / {
proxy_pass http://localhost:8266;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_redirect off;
# This fallback lets you serve a custom index.html
# from the server when Raveberry is not connected.
#error_page 502 /index.html;
#location ^~ /index.html {
# internal;
# root /usr/share/nginx/html;
#}
# special handling for the websocket endpoint
location /state {
proxy_pass http://localhost:8266;
proxy_http_version 1.1;
proxy_read_timeout 86400;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_set_header X-Forwarded-Host $server_name;
}
}
}