-
-
Notifications
You must be signed in to change notification settings - Fork 21
/
Copy pathsepia-client-nginx.conf
72 lines (67 loc) · 2.42 KB
/
sepia-client-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
# WebSockets
map $http_upgrade $connection_upgrade {
default upgrade;
'' close;
}
# Chrome remote debug
# NOTE: activate this only if you need to do remote debugging of the client!
# ALTERNATIVE: run SSH tunnel 'ssh -L 0.0.0.0:9223:localhost:9222 localhost -N'
#
# server {
# listen 9223;
# listen [::]:9223;
# server_name localhost;
#
# location / {
# proxy_pass http://127.0.0.1:9222;
# proxy_http_version 1.1;
# proxy_set_header Upgrade $http_upgrade;
# proxy_set_header Connection $connection_upgrade;
# proxy_read_timeout 14400;
# }
# }
# SEPIA HTTP
server {
listen 9090;
listen [::]:9090;
server_name localhost;
#allow [IP];
#deny all;
location /clexi {
proxy_pass http://127.0.0.1:8080;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection $connection_upgrade;
proxy_read_timeout 14400;
}
location /clexi/ {
if ($request_method = 'OPTIONS') {
add_header 'Access-Control-Allow-Origin' '*';
add_header 'Access-Control-Allow-Methods' 'GET, POST, OPTIONS';
#add_header 'Access-Control-Allow-Headers' 'DNT,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,Range';
add_header 'Access-Control-Allow-Headers' '*';
add_header 'Access-Control-Max-Age' 1728000;
add_header 'Content-Type' 'text/plain; charset=utf-8';
add_header 'Content-Length' 0;
return 204;
}
if ($request_method = 'POST') {
add_header 'Access-Control-Allow-Origin' '*' always;
add_header 'Access-Control-Allow-Methods' 'GET, POST, OPTIONS' always;
#add_header 'Access-Control-Allow-Headers' 'DNT,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,Range' always;
add_header 'Access-Control-Allow-Headers' '*' always;
add_header 'Access-Control-Expose-Headers' 'Content-Length,Content-Range' always;
}
if ($request_method = 'GET') {
add_header 'Access-Control-Allow-Origin' '*' always;
add_header 'Access-Control-Allow-Methods' 'GET, POST, OPTIONS' always;
#add_header 'Access-Control-Allow-Headers' 'DNT,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,Range' always;
add_header 'Access-Control-Allow-Headers' '*' always;
add_header 'Access-Control-Expose-Headers' 'Content-Length,Content-Range' always;
}
# Example of Basic-Auth protection
# auth_basic "CLEXI Authentication";
# auth_basic_user_file path/to/a/htpasswd;
proxy_pass http://127.0.0.1:8080/;
}
}