Kibana Apache2 Proxy 404

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","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, 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 / 404 6ms - 9.0B"}

My JS File: script.js - Pastebin.com
My Login Form (not the complete page): loginform.html - Pastebin.com

Any ideas on that?

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

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","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, 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 /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, 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 /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 OR 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, 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 /ui/favicons/favicon-32x32.png 304 2ms - 9.0B"}

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>
.
.

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