Created
July 15, 2014 14:00
-
-
Save romanmt/6faff49e9cf8d5e4813e to your computer and use it in GitHub Desktop.
Elasticsearch Nginx proxy From http://engineering.wattpad.com/post/78037079531/using-nginx-as-a-proxy-for-elasticsearch-and-how-to
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| upstream elasticsearch { | |
| server 10.0.0.1:9200; | |
| server 10.0.0.2:9200; | |
| server 10.0.0.3:9200; | |
| keepalive 64; | |
| } | |
| server { | |
| listen 9200; | |
| server_name search.proxy; | |
| client_max_body_size 50m; | |
| location / { | |
| proxy_pass http://elasticsearch; | |
| proxy_redirect off; | |
| proxy_http_version 1.1; | |
| proxy_set_header Connection ""; | |
| 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_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-Headers 'X-Requested-With, Content-Type'; | |
| add_header Access-Control-Allow-Credentials true; | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
ignore test