I have the following set-up:
/etc/nginx/sites-available/elasticsearch
server {
listen 80;
server_name xxx.xxx.xxx.xxx;
auth_basic "Elasticsearch Authentication";
auth_basic_user_file /etc/elasticsearch/es.pwd;
location / {
rewrite ^/(.*) /$1 break;
proxy_ignore_client_abort on;
proxy_pass http://localhost:9200;
proxy_redirect http://localhost:9200 http://xxx.xxx.xxx.xxx/;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $http_host;
}
}
whenever I do
curl -i -u user:pass http://xxx.xxx.xxx.xxx/
I get 401 Authorization Required
If I remove the auth_basic from nginx conf, everything works smoothly. It's clear to me that the auth bit is problemmatic. Am I doing something wrong?