-
Notifications
You must be signed in to change notification settings - Fork 0
/
nginx.conf
50 lines (43 loc) · 1.36 KB
/
nginx.conf
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
events {
worker_connections 1024;
}
http {
# Nginx will handle gzip compression of responses from the app server
gzip on;
gzip_proxied any;
gzip_types text/plain application/json;
gzip_min_length 1000;
server {
listen 443 ssl;
server_name localhost;
ssl_certificate nginx.crt;
ssl_certificate_key nginx.key;
client_max_body_size 0;
location ~ "^/[a-z0-9]{32}/geode/" {
if ($request_method !~ ^(DELETE|GET|POST|PUT|OPTIONS)$) {
return 405;
}
rewrite "^/[a-z0-9]{32}/geode/(.*)" /$1 break;
proxy_pass http://localhost:5000;
proxy_http_version 1.1;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
}
location ~ "^/[a-z0-9]{32}/viewer/" {
if ($request_method !~ ^(GET|POST|OPTIONS)$) {
return 405;
}
rewrite "^/[a-z0-9]{32}/viewer/(.*)" /$1 break;
proxy_pass http://localhost:1234;
proxy_http_version 1.1;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header Connection "keep-alive, Upgrade";
proxy_set_header Upgrade websocket;
}
}
}