I have an Nginx configuration that serves an AWS Kibana endpoint.
server {
listen 0.0.0.0:80;
location / {
proxy_pass http://<vpc-elasticsearch-endpoint>/_plugin/kibana/;
}
}
The problem is: when I access the Nginx URL, I'm redirected to another endpoint with a 302, (AWS cognito) which I can't access from browser.
The cognito URL looks like this : http://vpc-*****.amazonaws.com
I need to resolve the Cognito URL through Nginx itself. Maybe add another location block to resolve Cognito. So that the end user sees the original nginx endpoint that she used to access Nginx before redirected to Cognito.
How to achieve this in Nginx?