# Authorization Error When accessing elasticsearch through Kibana Nginx

**URL:** <https://discuss.elastic.co/t/authorization-error-when-accessing-elasticsearch-through-kibana-nginx/81915>\
**Category:** Elasticsearch\
**Created:** [April 11, 2017, 5:32am UTC](https://discuss.elastic.co/t/authorization-error-when-accessing-elasticsearch-through-kibana-nginx/81915 "2017-04-11T05:32:00Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Yaswanth](https://avatars.discourse-cdn.com/v4/letter/y/94ad74/32.png) [@Yaswanth](https://discuss.elastic.co/u/Yaswanth)\
**Post date:** [April 11, 2017, 5:32am UTC](https://discuss.elastic.co/t/authorization-error-when-accessing-elasticsearch-through-kibana-nginx/81915/1 "2017-04-11T05:32:00Z")

</div>

Hi,  
Installed Nginx in both elasticsearch and in Kibana servers. While trying to access the elasticsearch server through kibana it shows Authorization Error.

Kibana Nginx Config:

```
http {
    #include mime.types;
    default_type application/octet-stream;

    #access_log logs/access.log main;

    sendfile on;
    #tcp_nopush on;

    #keepalive_timeout 0;
    keepalive_timeout 65;

    #gzip on;
        upstream kibana {
    server 127.0.0.1:5601;
    keepalive 15;
  }
    server {
    listen *:443 ;
    ssl on;
    ssl_certificate /home/user/uat.cer;
    ssl_certificate_key /home/itadmin/uatkibana.key;
    auth_basic "Protected Elasticsearch";
    auth_basic_user_file passwords;

      location / {
      proxy_pass https://kibana;
      proxy_redirect off;
    }
  }
}

```

Kibana Config:

```
elasticsearch.url: "http://10.0.0.4:8080"
logging.dest: /var/log/kibana.log
elasticsearch.username: admin
elasticsearch.password: "admin"

```

Elasticsearch Nginx Config:

```
server {
    listen 8080;
   # auth_basic "Protected Elasticsearch";
   # auth_basic_user_file passwords;
      location / {
          # User access based on the role is specified in the LUA config file.
      access_by_lua_file 'authorize.lua';
      auth_basic "Protected Elasticsearch";
      auth_basic_user_file passwords;

      proxy_pass http://elasticsearch;
      #proxy_redirect off;
    }

```

Thanks

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [May 9, 2017, 5:33am UTC](https://discuss.elastic.co/t/authorization-error-when-accessing-elasticsearch-through-kibana-nginx/81915/2 "2017-05-09T05:33:10Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
