# Kibana Apache2 Proxy 404

**URL:** <https://discuss.elastic.co/t/kibana-apache2-proxy-404/135416>\
**Category:** Kibana\
**Created:** [June 11, 2018, 6:17pm UTC](https://discuss.elastic.co/t/kibana-apache2-proxy-404/135416 "2018-06-11T18:17:09Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![empfangsfehler](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/empfangsfehler/32/31520_2.png) [@empfangsfehler](https://discuss.elastic.co/u/empfangsfehler)\
**Post date:** [June 11, 2018, 6:17pm UTC](https://discuss.elastic.co/t/kibana-apache2-proxy-404/135416/1 "2018-06-11T18:17:10Z")

</div>

Hi Guys,

i managed to set up a loginsite for Kibana by my own with htaccess over Apache, so it is a little bit prettier than basic authentication.

I only have on troubles, when my form submits with the correct credentials, its redirectet to "/" which is ProxyPassed to "localhost:5601" but i get this response from kibana:

> {"statusCode":404,"error":"Not Found"}

When i click into the address bar and press ENTER, Kibana loads perfectly fine without problems.

In the Kibana logs i found this when clicking submit on my login form:

> Jun 11 20:04:37 scvelastic01.domain.local kibana[6794]: {"type":"response","@timestamp":"2018-06-11T18:04:37Z","tags":,"pid":6794,"method":"post","statusCode":404,"req":{"url":"/","method":"post","headers":{"host":"kibana.domain.local","cache-control":"max-age=0","origin":"[http://kibana.domain.local](http://kibana.domain.local)","upgrade-insecure-requests":"1","content-type":"application/x-www-form-urlencoded","user-agent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/67.0.3396.79 Safari/537.36","accept":"text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,_/_;q=0.8","referer":"[http://kibana.domain.local/","accept-encoding":"gzip](http://kibana.domain.local/%22,%22accept-encoding%22:%22gzip), deflate","accept-language":"en,de;q=0.9,en-GB;q=0.8,en-US;q=0.7,pl;q=0.6,da;q=0.5","x-forwarded-for":"172.19.1.10","x-forwarded-host":"kibana.domain.local","x-forwarded-server":"kibana.domain.local","connection":"Keep-Alive","content-length":"0"},"remoteAddress":"127.0.0.1","userAgent":"127.0.0.1","referer":"[http://kibana.domain.local/"},"res":{"statusCode":404,"responseTime":6,"contentLength":9},"message":"POST](http://kibana.domain.local/%22%7D,%22res%22:%7B%22statusCode%22:404,%22responseTime%22:6,%22contentLength%22:9%7D,%22message%22:%22POST) / 404 6ms - 9.0B"}

My JS File: [script.js - Pastebin.com](https://pastebin.com/1TsjFsXy)  
My Login Form (not the complete page): [loginform.html - Pastebin.com](https://pastebin.com/Wf8RYC7v)

Any ideas on that?

---

<div class="post-metadata">

**Author:** ![jbudz](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jbudz/32/45922_2.png) [@jbudz](https://discuss.elastic.co/u/jbudz)\
**Post date:** [June 11, 2018, 10:36pm UTC](https://discuss.elastic.co/t/kibana-apache2-proxy-404/135416/2 "2018-06-11T22:36:24Z")

</div>

Does redirecting to `localhost:5601/` or `localhost:5601/app/kibana` (trailing slash) help? Kibana's redirect can get confused without the trailing slash.

---

<div class="post-metadata">

**Author:** ![empfangsfehler](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/empfangsfehler/32/31520_2.png) [@empfangsfehler](https://discuss.elastic.co/u/empfangsfehler)\
**Post date:** [June 12, 2018, 5:31am UTC](https://discuss.elastic.co/t/kibana-apache2-proxy-404/135416/3 "2018-06-12T05:31:48Z")

</div>

Same issue - the ProxyPass works fine, but the problem i think might be caused by the Form itself after logging in.

This is the Output when i try connecting with my HTML Login Form:

> Jun 12 07:23:02 scvelastic01.domain.local kibana[15240]: {"type":"response","@timestamp":"2018-06-12T05:23:02Z","tags":,"pid":15240,"method":"post","statusCode":404,"req":{"url":"/app/kibana","method":"post","headers":{"host":"kibana.domain.local","cache-control":"max-age=0","origin":"[https://kibana.domain.local](https://kibana.domain.local)","upgrade-insecure-requests":"1","content-type":"application/x-www-form-urlencoded","user-agent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/67.0.3396.79 Safari/537.36","accept":"text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,_/_;q=0.8","referer":"[https://kibana.domain.local/","accept-encoding":"gzip](https://kibana.domain.local/%22,%22accept-encoding%22:%22gzip), deflate, br","accept-language":"en,de;q=0.9,en-GB;q=0.8,en-US;q=0.7,pl;q=0.6,da;q=0.5","x-forwarded-for":"172.16.51.128","x-forwarded-host":"kibana.domain.local","x-forwarded-server":"kibana.domain.local","connection":"Keep-Alive","content-length":"0"},"remoteAddress":"127.0.0.1","userAgent":"127.0.0.1","referer":"[https://kibana.domain.local/"},"res":{"statusCode":404,"responseTime":8,"contentLength":9},"message":"POST](https://kibana.domain.local/%22%7D,%22res%22:%7B%22statusCode%22:404,%22responseTime%22:8,%22contentLength%22:9%7D,%22message%22:%22POST) /app/kibana 404 8ms - 9.0B"}

> Jun 12 07:23:02 scvelastic01.domain.local kibana[15240]: {"type":"response","@timestamp":"2018-06-12T05:23:02Z","tags":,"pid":15240,"method":"get","statusCode":404,"req":{"url":"/favicon.ico","method":"get","headers":{"host":"kibana.domain.local","user-agent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/67.0.3396.79 Safari/537.36","accept":"image/webp,image/apng,image/_,_/\*;q=0.8","referer":"[https://kibana.domain.local/app/kibana","accept-encoding":"gzip](https://kibana.domain.local/app/kibana%22,%22accept-encoding%22:%22gzip), deflate, br","accept-language":"en,de;q=0.9,en-GB;q=0.8,en-US;q=0.7,pl;q=0.6,da;q=0.5","x-forwarded-for":"172.16.51.128","x-forwarded-host":"kibana.domain.local","x-forwarded-server":"kibana.domain.local","connection":"Keep-Alive"},"remoteAddress":"127.0.0.1","userAgent":"127.0.0.1","referer":"[https://kibana.domain.local/app/kibana"},"res":{"statusCode":404,"responseTime":7,"contentLength":9},"message":"GET](https://kibana.domain.local/app/kibana%22%7D,%22res%22:%7B%22statusCode%22:404,%22responseTime%22:7,%22contentLength%22:9%7D,%22message%22:%22GET) /favicon.ico 404 7ms - 9.0B"}

And this when i acces it without my form/authentication with the same URL ([https://kibana.domain.local/app/kibana](https://kibana.domain.local/app/kibana) OR [https://kibana.domain.local/](https://kibana.domain.local/))

> Jun 12 07:23:35 scvelastic01.domain.local kibana[15240]: {"type":"response","@timestamp":"2018-06-12T05:23:35Z","tags":,"pid":15240,"method":"get","statusCode":200,"req":{"url":"/app/kibana","method":"get","headers":{"host":"kibana.domain.local","upgrade-insecure-requests":"1","user-agent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/67.0.3396.79 Safari/537.36","accept":"text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,_/_;q=0.8","accept-encoding":"gzip, deflate, br","accept-language":"en,de;q=0.9,en-GB;q=0.8,en-US;q=0.7,pl;q=0.6,da;q=0.5","x-forwarded-for":"172.16.51.128","x-forwarded-host":"kibana.domain.local","x-forwarded-server":"kibana.domain.local","connection":"Keep-Alive"},"remoteAddress":"127.0.0.1","userAgent":"127.0.0.1"},"res":{"statusCode":200,"responseTime":20,"contentLength":9},"message":"GET /app/kibana 200 20ms - 9.0B"}

> Jun 12 07:23:35 scvelastic01.domain.local kibana[15240]: {"type":"response","@timestamp":"2018-06-12T05:23:35Z","tags":,"pid":15240,"method":"get","statusCode":304,"req":{"url":"/ui/favicons/favicon-32x32.png","method":"get","headers":{"host":"kibana.domain.local","user-agent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/67.0.3396.79 Safari/537.36","accept":"image/webp,image/apng,image/_,_/\*;q=0.8","referer":"[https://kibana.domain.local/app/kibana","accept-encoding":"gzip](https://kibana.domain.local/app/kibana%22,%22accept-encoding%22:%22gzip), deflate, br","accept-language":"en,de;q=0.9,en-GB;q=0.8,en-US;q=0.7,pl;q=0.6,da;q=0.5","if-none-match":""8e183c2e644fb050707d89402e1f7a120a95e4d2"","if-modified-since":"Thu, 12 Apr 2018 20:58:09 GMT","x-forwarded-for":"172.16.51.128","x-forwarded-host":"kibana.domain.local","x-forwarded-server":"kibana.domain.local","connection":"Keep-Alive"},"remoteAddress":"127.0.0.1","userAgent":"127.0.0.1","referer":"[https://kibana.domain.local/app/kibana"},"res":{"statusCode":304,"responseTime":2,"contentLength":9},"message":"GET](https://kibana.domain.local/app/kibana%22%7D,%22res%22:%7B%22statusCode%22:304,%22responseTime%22:2,%22contentLength%22:9%7D,%22message%22:%22GET) /ui/favicons/favicon-32x32.png 304 2ms - 9.0B"}

---

<div class="post-metadata">

**Author:** ![empfangsfehler](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/empfangsfehler/32/31520_2.png) [@empfangsfehler](https://discuss.elastic.co/u/empfangsfehler)\
**Post date:** [June 22, 2018, 6:14pm UTC](https://discuss.elastic.co/t/kibana-apache2-proxy-404/135416/4 "2018-06-22T18:14:50Z")

</div>

I fixed the issues by myself by using a redirecting page instead of directly going from the form to kibana:

```
.
.
<script type="text/javascript">
	function countdown() {
		var i = document.getElementById('counter');
		if (parseInt(i.innerHTML)<=2) {
		  location.href = 'https://kibana.pankl.local/';
		}
		i.innerHTML = parseInt(i.innerHTML)-1;
	}
	setInterval(function(){ countdown(); },500);
</script>
.
.
```

---

<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 20, 2018, 6:14pm UTC](https://discuss.elastic.co/t/kibana-apache2-proxy-404/135416/5 "2018-07-20T18:14:52Z")

</div>

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