# Kibana 4 as reverse proxy

**URL:** <https://discuss.elastic.co/t/kibana-4-as-reverse-proxy/26751>\
**Category:** Kibana\
**Created:** [August 3, 2015, 8:58pm UTC](https://discuss.elastic.co/t/kibana-4-as-reverse-proxy/26751 "2015-08-03T20:58:31Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![niraj\_kumar](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/niraj_kumar/32/4130_2.png) [@niraj\_kumar](https://discuss.elastic.co/u/niraj_kumar)\
**Post date:** [August 3, 2015, 8:58pm UTC](https://discuss.elastic.co/t/kibana-4-as-reverse-proxy/26751/1 "2015-08-03T20:58:31Z")

</div>

Hi All,

Does anyone know how to configure apache to use kibana 4 as reverse proxy. Kibana 3 works perfectly fine but kibana 4 gives me an error. Unable to load "text!config" modules because of an unknown error apache

Anyone aware of this fix?

Regards  
Niraj

---

<div class="post-metadata">

**Author:** ![magnusbaeck](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/magnusbaeck/32/44943_2.png) [@magnusbaeck](https://discuss.elastic.co/u/magnusbaeck)\
**Post date:** [August 6, 2015, 8:51am UTC](https://discuss.elastic.co/t/kibana-4-as-reverse-proxy/26751/2 "2015-08-06T08:51:43Z")

</div>

What does the proxy portion of your Apache look like? Which Apache version? Does it work without the reverse proxy (i.e. if you head straight for port 5601)?

---

<div class="post-metadata">

**Author:** ![Ben19](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ben19/32/3745_2.png) [@Ben19](https://discuss.elastic.co/u/Ben19)\
**Post date:** [August 6, 2015, 4:23pm UTC](https://discuss.elastic.co/t/kibana-4-as-reverse-proxy/26751/3 "2015-08-06T16:23:37Z")

</div>

> [@niraj\_kumar](#):
>
> text!config

Number of fixes found in this article: [reverse-proxy: Unable to load "text!config" modules because of an unknown error. · Issue #1653 · elastic/kibana · GitHub](https://github.com/elastic/kibana/issues/1653)

I know they were using NGINX but if you setup Apache  
correctly then it may help, just to add as well, I would recommend NGINX if you’re  
just using it as a reverse proxy since NGINX is less resource heavy than  
Apache. Apache is a full end web server as per design but originally NGINX was  
just a RP.

---

<div class="post-metadata">

**Author:** ![niraj\_kumar](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/niraj_kumar/32/4130_2.png) [@niraj\_kumar](https://discuss.elastic.co/u/niraj_kumar)\
**Post date:** [August 10, 2015, 11:53pm UTC](https://discuss.elastic.co/t/kibana-4-as-reverse-proxy/26751/4 "2015-08-10T23:53:06Z")

</div>

Hi Magnusbaeck,

I am using apache with reverse proxy between two instances using balancer method. Here is my config.

Apache on web tier:

\<VirtualHost \*:443\>  
ServerName [elk@xxx.com](mailto:elk@xxx.com)  
ServerAdmin webmaster@localhost

## Vhost docroot

DocumentRoot "/opt/kibana3/src"

## Directories, there should at least be a declaration for /opt/kibana3/src

\<Directory "/opt/kibana3/src"\>  
Options Indexes FollowSymLinks MultiViews  
AllowOverride None  
Order allow,deny  
Allow from all

## Load additional static includes

## Logging

ErrorLog "/var/log/apache2/ssl\_error.log"  
ServerSignature Off  
CustomLog "/var/log/apache2/ssl\_access.log" "%h %D %u %t "%r" %\>s %O "%{Referer}i" "%{User-Agent}i""

## Proxy rules

ProxyRequests Off

ProxyPass /es balancer://elk-prod-01-es/  
\<Location /es\>  
ProxyPassReverse balancer://elk-prod-01-es/

ProxyPass /\_plugin/marvel balancer://elk-prod-01-es/\_plugin/marvel  
\<Location /\_plugin/marvel\>  
ProxyPassReverse balancer://elk-prod-01-es/\_plugin/marvel

```
ProxyPass /_plugin/head balancer://elk-prod-01-es/_plugin/head

```

\<Location /\_plugin/head\>  
ProxyPassReverse balancer://elk-prod-01-es/\_plugin/head

ProxyPass /\_plugin/bigdesk balancer://elk-prod-01-es/\_plugin/bigdesk  
\<Location /\_plugin/bigdesk\>  
ProxyPassReverse balancer://elk-prod-01-es/\_plugin/bigdesk

## Redirect rules

Redirect /marvel /\_plugin/marvel  
Redirect /head /\_plugin/head  
Redirect /bigdesk /\_plugin/bigdsek

## SSL directives

SSLEngine on  
SSLCertificateFile "/etc/ssl/certs/elk.crt"  
SSLCertificateKeyFile "/etc/ssl/private/elk.key"  
SSLCACertificatePath "/etc/ssl/certs"  
SSLCACertificateFile "/etc/ssl/certs/ca-certificates.crt"  
SSLProtocol All -SSLv2 -SSLv3

## Custom fragment

# Configure SSL

SSLProxyEngine On

#Disable gzip for apache  
SetEnv no-gzip 1

And the app tier has a rule to a proxy pass

ProxyPass /kibana [http://localhost:5601/kibana](http://localhost:5601/kibana)  
ProxyPassReverse /kibana [http://localhost:5601/kibana](http://localhost:5601/kibana)

And yes if i directly use app tier's IP with port 5601 port i can access it without any pain.

Thanks for the help !

Regards  
Niraj

---

<div class="post-metadata">

**Author:** ![magnusbaeck](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/magnusbaeck/32/44943_2.png) [@magnusbaeck](https://discuss.elastic.co/u/magnusbaeck)\
**Post date:** [August 11, 2015, 3:39am UTC](https://discuss.elastic.co/t/kibana-4-as-reverse-proxy/26751/5 "2015-08-11T03:39:02Z")

</div>

> ProxyPass /kibana [http://localhost:5601/kibana](http://localhost:5601/kibana)  
> ProxyPassReverse /kibana [http://localhost:5601/kibana](http://localhost:5601/kibana)

I think you want to have trailing slashes here, and more importantly no kibana directory on the right hand side:

```
ProxyPass /kibana/ http://localhost:5601/
ProxyPassReverse /kibana/ http://localhost:5601/

```

Without the trailing slashes, relative URLs tend to get screwed up. The debugging console of your browser will indicate such problems quite clearly.

---

<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:** [July 6, 2017, 2:15pm UTC](https://discuss.elastic.co/t/kibana-4-as-reverse-proxy/26751/6 "2017-07-06T14:15:06Z")

</div>


