Nginx proxy for Elastic Cloud instance

I am trying to create an Nginx reverse proxy to a cloud.elastic.co instance. All attempts at this result in the following message:

{"ok":false,"message":"Unknown cluster."}

upstream elasticsearch {
    server {{my instance}}.us-west-2.aws.found.io:9243;
    keepalive 15;
}

server {
    listen 9200;
    server_name localhost;
    location / {
      proxy_pass https://elasticsearch;
      proxy_http_version 1.1;
      proxy_set_header Connection "Keep-Alive";
      proxy_set_header Proxy-Connection "Keep-Alive";
      proxy_set_header Authorization "Basic {{base64 of user:pass}}";
    }
}

Add proxy_set_header Host {{my instance}}.us-west1.gcp.cloud.es.io:9243;

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