forked from matchID-project/frontend
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathnginx.conf
48 lines (36 loc) · 1.03 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
server {
listen 80 default_server;
location / {
proxy_pass http://frontend:8080;
}
location /matchID {
root /var/www;
}
location /matchID/validation {
proxy_pass http://frontend:8080;
}
location ~ .*(_search|_msearch).* {
# Deny Nodes Shutdown API
if ($request_filename ~ "_shutdown") {
return 403;
break;
}
# Deny access to Cluster API
if ($request_filename ~ "_cluster") {
return 403;
break;
}
# Pass requests to ElasticSearch
proxy_pass http://elasticsearch:9200;
proxy_redirect off;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $http_host;
# For CORS Ajax
proxy_pass_header Access-Control-Allow-Origin;
proxy_pass_header Access-Control-Allow-Methods;
proxy_hide_header Access-Control-Allow-Headers;
add_header Access-Control-Allow-Origin '*';
add_header Access-Control-Allow-Headers 'X-Requested-With, Content-Type';
}
}