title: Elasticsearch reindex - unknown_host_exception
body: <p>I try to reindex from a remote server.
  Elasticsearch instance on the remote server is behind a nginx proxy and its url is api.example.com/api/elasticsearch on port 80.</p>
  
  <p>I'm able to access the remote elasticsearch and perform queries. E.g. </p>
  
  <pre><code>curl http://api.example.com:80/api/elasticsearch/_cat/indices?v
  </code></pre>
  
  <p>gives the expected result.</p>
  
  <p>However when I try to reindex a local elasticsearch index from the remote index as follows</p>
  
  <pre><code>curl -X POST http://elasticsearch:9200/_reindex -d '{ 
      "source": {
          "remote": { 
              "host": "http://api.example.com/api/elasticsearch:80"
          }, 
          "index": "alias_name" 
      }, 
      "dest": { 
          "index": "index_name" 
      }
  }'
  </code></pre>
  
  <p>I receive an error:</p>
  
  <pre><code>{"error":{"root_cause":[{"type":"unknown_host_exception","reason":"api.example.com/api/elasticsearch: Name or service not known"}],"type":"unknown_host_exception","reason":"api.example.com/api/elasticsearch: Name or service not known"},"status":500}
  </code></pre>