Welcome! Log In Create A New Profile

Advanced

Nginx location "/something" not working

Posted by chtiouiha 
Nginx location "/something" not working
July 24, 2015 08:43AM
Hello,

I'm working on an ubuntu machine and i want to use nginx to redirect to kibana interfaces.
I have two kibanas installed on my machine.
1st kibana url: localhost:5601
2nd kibanaurl: localhost:5602

I have nginx installed and running;

This is my kibana.yml under /etc/nginx/conf.d/

--- Begin ------------------------------------------------------------------------------------------------------
server {
listen 80;

server_name exemple.com;

location / {
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;
proxy_cache_bypass $http_upgrade;
}
location /admin {
proxy_pass http://localhost:5602;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection 'upgrade';
proxy_set_header Host $host;
proxy_cache_bypass $http_upgrade;
}
}
--- End ------------------------------------------------------------------------------------------------------

the two kibanas server are running pretty good when a tape:
curl 'localhost:5601' or curl 'localhost:5602'
and nginx is reloaded after the kibana.conf's modification:

--- Begin -----------------------------------------------------------------------------------------------------
[user@machine]$ sudo /etc/init.d/nginx reload
Reloading nginx: [ OK ]
--- End -------------------------------------------------------------------------------------------------------

the problem is that i'm not able to access the second kibana via "exemple.com/admin"
exemple.com/ is returning me the 1st kibana interface.. but exemple.com/admin return me a html page in it's body "Not Found"

Is that expected?
If yes, how can i define this??

Thanks a lot
Re: Nginx location "/something" not working
July 24, 2015 10:25AM
location /admin {
rewrite /admin/([^/]+) /$1 break;
proxy_pass http://localhost:5602;
...........

---
nginx for Windows http://nginx-win.ecsds.eu/
Re: Nginx location "/something" not working
July 28, 2015 04:23AM
Hello,

I copy/paste this in my conf file..
==> NOT WORKING...

What u mean with this?? i didn't understand it..

Thanks for your response..
Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 234
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 500 on July 15, 2024
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready