Created
May 3, 2016 12:23
-
-
Save acherunilam/1b7751b7190f0727decb7f2f5588ff18 to your computer and use it in GitHub Desktop.
Nginx config for InfluxDB HA
This file contains 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
http { | |
client_max_body_size 20M; | |
upstream influxdb { | |
server server1:8086; | |
server server2:8086; | |
} | |
upstream relay { | |
server server1:9096; | |
server server2:9096; | |
} | |
server { | |
listen 7076; | |
location /query { | |
limit_except GET { | |
deny all; | |
} | |
proxy_pass http://influxdb; | |
} | |
location /write { | |
limit_except POST { | |
deny all; | |
} | |
proxy_pass http://relay; | |
} | |
} | |
} | |
stream { | |
upstream test { | |
server server1:8003; | |
server server2:8003; | |
} | |
server { | |
listen 7003 udp; | |
proxy_pass test; | |
proxy_timeout 1s; | |
proxy_responses 1; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
You should use a version of Nginx that has been compiled with the stream module. Just use the mainline branch of Nginx, it comes with the stream module.