Skip to content

Instantly share code, notes, and snippets.

@acherunilam
Created May 3, 2016 12:23
Show Gist options
  • Star 5 You must be signed in to star a gist
  • Fork 8 You must be signed in to fork a gist
  • Save acherunilam/1b7751b7190f0727decb7f2f5588ff18 to your computer and use it in GitHub Desktop.
Save acherunilam/1b7751b7190f0727decb7f2f5588ff18 to your computer and use it in GitHub Desktop.
Nginx config for InfluxDB HA
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;
}
}
@acherunilam
Copy link
Author

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment