events { worker_connections 1024; } http { server { listen 80; # error logging error_log /var/log/nginx/elasticsearch_error.log; # authentication: kibana auth_basic "Kibana Auth"; auth_basic_user_file /etc/nginx/.secrets_kibana; location / { # ES Domain name WITHOUT https:// proxy_set_header Host ; #IP of Nginx EC2 Instance proxy_set_header X-Real-IP ; proxy_buffer_size 128k; proxy_buffers 4 256k; proxy_busy_buffers_size 256k; proxy_set_header Connection "Keep-Alive"; proxy_set_header Proxy-Connection "Keep-Alive"; proxy_http_version 1.1; proxy_set_header Authorization ""; #Elasticsearch Kibana endpoint proxy_pass https:///_plugin/kibana/; #Elasticsearch Kibana endpoint and IP of Nginx EC2 Instance proxy_redirect https:///_plugin/kibana/ http://; } location ~ (/app/kibana|/app/timelion|/bundles|/es_admin|/plugins|/api|/ui|/elasticsearch) { #Elasticsearch Domain endpoint proxy_pass https://; proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header X-Forwarded-Proto $scheme; proxy_set_header X-Forwarded-Host $http_host; proxy_set_header Authorization ""; } } }