Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docker mobz/elasticsearch-head:5 elasticsearch nginx http basic auth not work #422

Open
xcyxiner opened this issue Sep 20, 2019 · 1 comment

Comments

@xcyxiner
Copy link

head 5

docker run -d --name testhead --link elasticsearch_test:elasticsearch -p 9100:9100 mobz/elasticsearch-head:5

elasticsearch docker

docker run -d --name testes  -p 127.0.0.1:9200:9200 -p 127.0.0.1:9300:9300 -e "discovery.type=single-node" elasticsearch:5

elasticsearch yml

http.host: 0.0.0.0
#network.host: 127.0.0.1

# Uncomment the following lines for a production cluster deployment
#transport.host: 0.0.0.0
#discovery.zen.minimum_master_nodes: 1
http.cors.enabled: true
http.cors.allow-origin: "*"
http.cors.allow-methods : OPTIONS, HEAD,GET, POST, PUT, DELETE
http.cors.allow-headers : X-Requested-With,X-Auth-Token,Content-Type,Content-Length,Authorization

elasticsearch nginx http basic auth

server {
        listen 80;
        server_name testes.xxx.xxx;
        root html;

        location / {
                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 Upgrade $http_upgrade;
                proxy_set_header Connection "upgrade";

        auth_basic            "Elasticsearch please";
        auth_basic_user_file  /path/to/http/basic/auth/password;

                proxy_pass http://testes/;

         add_header Access-Control-Allow-Origin "*";
         add_header Access-Control-Allow-Methods "GET, POST, PUT, OPTIONS";
         add_header Access-Control-Allow-Headers "Content-Type,Accept,Authorization, x-requested-with";

        }
}

upstream testes{
server 127.0.0.1:9200;
}

test docker elasticsearch-head, try connet error

  • try nginx proxy url ,not work
http://testes.xxx.xxx?auth_user=xxx&auth_password=xxx
  • try docker link url (http//elasticsearch_test:9200) ,not work
in head docker container, "curl http//elasticsearch_test:9200" test commad is work

test chrome elasticsearch-head plugin is work

@philipskokoh
Copy link
Collaborator

yes, you are correct. mobz/elasticsearch-head:5 not updated with the latest codes...
@mobz: do you want to publish latest docker updates?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants