Nginx proxy for Elastic Cloud instance

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

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

upstream elasticsearch {
    server {{my instance}};
    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}};

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