Skip to content

Instantly share code, notes, and snippets.

@stewones
Created April 2, 2019 15:46
Show Gist options
  • Save stewones/f1194ad315808fb21b358904f39310bd to your computer and use it in GitHub Desktop.
Save stewones/f1194ad315808fb21b358904f39310bd to your computer and use it in GitHub Desktop.
elasticsearch config for nginx (say no to x-pack)
events {
worker_connections 1024;
}
http {
upstream elasticsearch {
server 127.0.0.1:9200;
keepalive 15;
}
upstream kibana {
server 127.0.0.1:5601;
keepalive 15;
}
# elastic
server {
listen 4545;
auth_basic "You Know, for Security =x";
auth_basic_user_file /etc/nginx/.htpasswd;
location / {
proxy_pass http://elasticsearch;
proxy_redirect off;
proxy_http_version 1.1;
proxy_set_header Connection "Keep-Alive";
proxy_set_header Proxy-Connection "Keep-Alive";
}
}
# kibana
server {
listen 4546;
auth_basic "You Know, for Security =x";
auth_basic_user_file /etc/nginx/.htpasswd;
location / {
proxy_pass http://kibana;
proxy_redirect off;
proxy_http_version 1.1;
proxy_set_header Connection "Keep-Alive";
proxy_set_header Proxy-Connection "Keep-Alive";
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment