Skip to content

Instantly share code, notes, and snippets.

@douglasresende
Forked from tebeka/docker-compose.yml
Created August 11, 2017 00:50
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save douglasresende/e0d65fc5e45d89c84d20e997e1fe63ad to your computer and use it in GitHub Desktop.
HAProxy in front of Elasticsearch
elastic:
image: elasticsearch
haproxy:
image: haproxy
volumes:
- ${PWD}:/usr/local/etc/haproxy
links:
- elastic
ports:
- "9200:9200"
# Based on http://j.mp/1YHQFgZ
# vim: ft=haproxy
defaults
timeout connect 5000
timeout client 10000
timeout server 10000
frontend elastic
bind :9200
mode http
acl is_delete method DELETE
http-request deny if is_delete
default_backend elastic
backend elastic
mode http
option forwardfor
balance source
option httpclose
server es1 elastic:9200 weight 1 check inter 1000 rise 5 fall 1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment