Welcome! Log In Create A New Profile

Advanced

Nginx Reverse proxy -Aws elastic search - Not working

Posted by saikiran 
Nginx Reverse proxy -Aws elastic search - Not working
July 21, 2020 02:10AM
Hello,

Greetings

I have 2 Aws elasticsearch domains (test/prod). i need to access both kibana dashboard using single nginx reverse proxy server.
can any please help me with nginx config file and steps.

Url :
1) https://elastic-endpoint.test.amazonaws.com;
2) https://elastic-endpoint.prod.amazonaws.com;

need to access both urls using single nginx reverse proxy server(ec2) .

below steps i have tried to achieve that :

1) Created Ec2 (ubuntu ) instance in same vpc which elastic domains are reside.
2) installed nginx in instance.
3) unlinked the Default - site enabled folder
4) created elasticsearch config file.

config file :

server {
listen 80;
location /test/{
proxy_set_header X-Forwarded-For $remote_addr;
proxy_set_header Host $http_host;
rewrite ^/test/(.*) $1 break;
proxy_pass https://elastic-endpoint.test.amazonaws.com;
}

location /prod/{
proxy_set_header X-Forwarded-For $remote_addr;
proxy_set_header Host $http_host;
rewrite ^/prod/(.*) $1 break;
proxy_pass https://elastic-endpoint.prod.amazonaws.com;
}
}

5) by trying ngnix -t i am getting

nginx: the configuration file /etc/nginx/nginx.conf syntax is ok
nginx: configuration file /etc/nginx/nginx.conf test is successful

6) sudo service nginx reload

7) after trying that i am getting 404 not found error

Can anyone please assist me

Thanks
Sai
Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 83
Record Number of Users: 6 on February 13, 2018
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready