# Elastic Search Behind Apache Reverse Proxy But Kibana Faces Problems Accessing ES

**URL:** <https://discuss.elastic.co/t/elastic-search-behind-apache-reverse-proxy-but-kibana-faces-problems-accessing-es/31801>\
**Category:** Kibana\
**Created:** [October 7, 2015, 7:44pm UTC](https://discuss.elastic.co/t/elastic-search-behind-apache-reverse-proxy-but-kibana-faces-problems-accessing-es/31801 "2015-10-07T19:44:06Z")\
**Posts on this page:** 1\
**Showing post:** 4

<div class="post-metadata">

**Author:** ![kachenjr](https://avatars.discourse-cdn.com/v4/letter/k/bc8723/32.png) [@kachenjr](https://discuss.elastic.co/u/kachenjr)\
**Post date:** [January 26, 2016, 4:36am UTC](https://discuss.elastic.co/t/elastic-search-behind-apache-reverse-proxy-but-kibana-faces-problems-accessing-es/31801/4 "2016-01-26T04:36:16Z")

</div>

I know this is a year old thread.. but I ended up here trying to find rules for getting elasticsearch and kibana to be virtuals behind apache. The config here helped, and I was able to figure it out ( so far anyway ). You're on the right track, but you have to alias it to elasticsearch, not es, for kibana to work correctly. There are calls out to an elasticsearch url in the logs. Not sure why yet, probably some n00b error on my part with a setting. After that, I had to create aliases for app ( for kibana and sense ) and bundles ( for the url kibana uses to get its guts ). Here's what I ended up with ( ProxyHTMLURLMap didn't work on my apache install.. so I left it of. Still works ).  
I'd be happy to hear I'm still doing this wrong, and it's all easier than this. Not secure now, but I'm just trying to get it up and running to test it out.

> # Rewrite URL that starts and ends with /elasticsearch. Redirect it to /elasticsearch/
> 
> RewriteEngine On  
> RewriteRule "^/elasticsearch/elasticsearch/" "/elasticsearch/" [R]  
> RewriteRule "^/elasticsearch$" "/elasticssearch/" [R]

> RewriteRule "^/app/kibana/" "/app/" [R]  
> RewriteRule "^/app$" "/app/" [R]

> RewriteRule "^/bundles/bundles/" "/bundles/" [R]  
> RewriteRule "^/bundles$" "/bundles/" [R]

> # Set Standard (Forward) Proxy Off ...
> 
> ProxyRequests off  
> ProxyPreserveHost On

> \<Location /elasticsearch/ \>  
> Options All  
> Order deny,allow  
> Allow from all

> # Define the actual proxy mapping and redirection
> 
> LogLevel debug  
> ProxyPass [http://localhost:9200/](http://localhost:9200/) retry=0 timeout=5  
> ProxyPassReverse [http://localhost:9200/](http://localhost:9200/)  
> ProxyPassReverseCookiePath / /elasticsearch/

> 

> \<Location /app/ \>  
> Options All  
> Order deny,allow  
> Allow from all

> LogLevel debug  
> ProxyPass [http://localhost:5601/app/](http://localhost:5601/app/) retry=0 timeout=5  
> ProxyPassReverse [http://localhost:5601/app/](http://localhost:5601/app/)  
> ProxyPassReverseCookiePath / /app/

> \<Location /bundles/ \>  
> Options All  
> Order deny,allow  
> Allow from all

> LogLevel debug  
> ProxyPass [http://localhost:5601/bundles/](http://localhost:5601/bundles/) retry=0 timeout=5  
> ProxyPassReverse [http://localhost:5601/bundles/](http://localhost:5601/bundles/)  
> ProxyPassReverseCookiePath / /app/

---

_[View the full topic](https://discuss.elastic.co/t/elastic-search-behind-apache-reverse-proxy-but-kibana-faces-problems-accessing-es/31801)._
