forked from thomas-hilaire/jmap-perl
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathnginx.conf
105 lines (89 loc) · 2.76 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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
server {
listen 80;
server_name proxy.jmap.io;
root /home/jmap/jmap-perl/htdocs/;
index index.html index.htm;
location / {
# First attempt to serve request as file, then
# as directory, then fall back to displaying a 404.
try_files $uri $uri/ /index.html;
}
location = / {
if ( $request_method = 'OPTIONS' ) {
add_header 'Access-Control-Allow-Origin' '*';
# -D GAPING_SECURITY_HOLE
add_header 'Access-Control-Allow-Headers' $http_access_control_request_headers;
add_header 'Access-Control-Allow-Methods' 'POST, GET, OPTIONS';
add_header 'Access-Control-Max-Age' 600;
add_header 'Content-Type' 'text/plain; charset=UTF-8';
add_header 'Content-Length' 0;
return 204;
}
# First attempt to serve request as file, then
# as directory, then fall back to displaying a 404.
proxy_pass http://127.0.0.1:9000/home;
}
location /events/ {
if ( $request_method = 'OPTIONS' ) {
add_header 'Access-Control-Allow-Origin' '*';
# -D GAPING_SECURITY_HOLE
add_header 'Access-Control-Allow-Headers' $http_access_control_request_headers;
add_header 'Access-Control-Allow-Methods' 'POST, GET, OPTIONS';
add_header 'Access-Control-Max-Age' 600;
add_header 'Content-Type' 'text/plain; charset=UTF-8';
add_header 'Content-Length' 0;
return 204;
}
# Immediately send backend responses back to client
proxy_buffering off;
# Disable keepalive to browser
keepalive_timeout 0;
# It's a long lived backend connection with potentially a long time between
# push events, make sure proxy doesn't timeout
proxy_read_timeout 7200;
proxy_pass http://127.0.0.1:9001/events/;
}
location /files/ {
proxy_pass http://127.0.0.1:9000/files/;
}
location /jmap/ {
if ( $request_method = 'OPTIONS' ) {
add_header 'Access-Control-Allow-Origin' '*';
# -D GAPING_SECURITY_HOLE
add_header 'Access-Control-Allow-Headers' $http_access_control_request_headers;
add_header 'Access-Control-Allow-Methods' 'POST, GET, OPTIONS';
add_header 'Access-Control-Max-Age' 600;
add_header 'Content-Type' 'text/plain; charset=UTF-8';
add_header 'Content-Length' 0;
return 204;
}
proxy_pass http://127.0.0.1:9000/jmap/;
}
location /upload/ {
proxy_pass http://127.0.0.1:9000/upload/;
}
location /raw/ {
proxy_pass http://127.0.0.1:9000/raw/;
}
location /A {
proxy_pass http://127.0.0.1:9000/A;
}
location /J {
proxy_pass http://127.0.0.1:9000/J;
}
location /U {
proxy_pass http://127.0.0.1:9000/U;
}
location /register {
proxy_pass http://127.0.0.1:9000/register;
}
location /signup {
proxy_pass http://127.0.0.1:9000/signup;
}
location /delete {
proxy_pass http://127.0.0.1:9000/delete;
}
location /cb {
proxy_pass http://127.0.0.1:9000/cb;
}
}