-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathnginx-elastic.conf
34 lines (32 loc) · 1.09 KB
/
nginx-elastic.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
daemon off;
events {
worker_connections 1024;
}
http {
server {
listen 9200;
server_name localhost;
rewrite ^/(.*) /$1 break;
proxy_ignore_client_abort on;
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;
proxy_set_header Access-Control-Allow-Origin "*";
location ~ ^(/|/_aliases|/_search|.*_search|.*/_mapping|/_cluster.*|/_status.*|/_nodes)$ {
limit_except GET POST OPTIONS {
deny all;
}
proxy_pass http://elasticsearch:9200;
proxy_pass_request_headers on;
}
location ~ ^(.*/_bulk|.*/_doc|.*/_create|/_cluster.*|.*/_delete_by_query|.*/_update_by_query|/_reindex)$ {
limit_except GET {
deny all;
}
auth_basic "Administrator’s Area";
auth_basic_user_file /etc/nginx/.htpasswd;
proxy_pass http://elasticsearch:9200;
proxy_pass_request_headers on;
}
}
}