# Kibana 4.6 directory structure

**URL:** <https://discuss.elastic.co/t/kibana-4-6-directory-structure/66542>\
**Category:** Kibana\
**Created:** [November 18, 2016, 1:30pm UTC](https://discuss.elastic.co/t/kibana-4-6-directory-structure/66542 "2016-11-18T13:30:23Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![vvs14](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/vvs14/32/11328_2.png) [@vvs14](https://discuss.elastic.co/u/vvs14)\
**Post date:** [November 18, 2016, 1:30pm UTC](https://discuss.elastic.co/t/kibana-4-6-directory-structure/66542/1 "2016-11-18T13:30:23Z")

</div>

Hi,

I am using Kibana4.1.4 with ES 1.7 and creating log export using Elasticdump behind Nginx. I have Keystone for authentication purpose and I have wrote code for authentication logic in `KibanaDir/src/app.js` file.

Now I am trying to upgrade Kibana to 4.6.1 with ES 2.4 and kibana app is now hosted at `/app/kibana` rather than `/kibana` and code and directory structure is changed as well.  
I have found the work around with Nginx

> `location ~ (/app/kibana|/bundles/|/kibana4|/status|/plugins) { proxy_pass http://localhost:5601; proxy_http_version 1.1; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection "upgrade"; proxy_set_header Host $host; rewrite /kibana4/(.*)$ /$1 break; }`

I am unable to find the module where I can add my code to enable authentication with Keystone and I think this is causing issue with export.

Can anyone please help me with new directory structure of Kibana4.6.1 and their purpose as lead?  
Thanks.

---

<div class="post-metadata">

**Author:** ![tylersmalley](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/tylersmalley/32/8833_2.png) [@tylersmalley](https://discuss.elastic.co/u/tylersmalley)\
**Post date:** [November 20, 2016, 8:37pm UTC](https://discuss.elastic.co/t/kibana-4-6-directory-structure/66542/2 "2016-11-20T20:37:26Z")

</div>

I am not familiar with Keystone, can you point me in the right direction so I can further understand?

Also, what do you mean by "and their purpose as lead"

---

<div class="post-metadata">

**Author:** ![vvs14](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/vvs14/32/11328_2.png) [@vvs14](https://discuss.elastic.co/u/vvs14)\
**Post date:** [November 21, 2016, 9:15am UTC](https://discuss.elastic.co/t/kibana-4-6-directory-structure/66542/3 "2016-11-21T09:15:53Z")

</div>

Thanks for the reply. "and their purpose as lead" is just asking that help with directory structure as lead/help to solve this problem. That is nothing.

With Kibana 4.1.4, `KibanaDir/src/app.j`s file was starting point of Kibana so previous developer added some functions(NodeJS) to contact Keystone for token and authenticate user. I guess you need not to know about Keystone to help me here.

For context, that code helps getting user's token from Keystone and other things, so that Kibana can only be accessed through the some domain, not just be typing `myIP:5601`.

I would like to know where(which file in Kibana 4.6.1) I could add those functions , so that authentication can take place before starting Kibana. I am very much confused and have no idea of NodeJS but bit idea of JS.

Thanks.

---

<div class="post-metadata">

**Author:** ![vvs14](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/vvs14/32/11328_2.png) [@vvs14](https://discuss.elastic.co/u/vvs14)\
**Post date:** [November 24, 2016, 7:52am UTC](https://discuss.elastic.co/t/kibana-4-6-directory-structure/66542/4 "2016-11-24T07:52:25Z")

</div>

Diff to both `app.js` file can be seen at:  
[https://www.diffchecker.com/GAbuyYcG](https://www.diffchecker.com/GAbuyYcG)

---

<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:** [December 22, 2016, 7:52am UTC](https://discuss.elastic.co/t/kibana-4-6-directory-structure/66542/5 "2016-12-22T07:52:47Z")

</div>

Closed on December 22, 2016, 7:52am UTC

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