Could not make HTTP request to instance: connection closed before message completed

I have deployed an elasticsearch container over Fly using a Dockerfile. The container operates over https protocol. But whenever i send the request to the deployed address, it shows this message:

When i disabled http security in my configuration files, then it was able to accept the requests. So, as i understand what is happening is that i send https request to Fly on the deployed url, it receives them and sends a request to elasticsearch VM over http but the thing is elasticsearch receives request over https that’s why it is not working… is it a correct assumption? If it is how can i fix fly proxy to send https requests to elastic search??

This is controlled by your fly.toml. If this currently contains a http_service section you may need to replace it with services section. Make sure that you do not specify the tls handler.

You may also need a dedicated IPv4 address.

Hi thanks for your reply, this is my fly.toml file right now:

app = "elastic-search-container"
primary_region = "fra"

[build]

[http_service]
  internal_port = 9200
  force_https = true
  auto_stop_machines = false
  auto_start_machines = false
  min_machines_running = 0
  processes = ["app"]

will it work if i just changed it to this??:

app = "elastic-search-container"
primary_region = "fra"

[build]

[[services]
  internal_port = 9200
  force_https = true
  auto_stop_machines = false
  auto_start_machines = false
  min_machines_running = 0
  processes = ["app"]

I haven’t tried it with elastic search, but your configuration will look more like the following:

[[services]]
  protocol = "tcp"
  internal_port = 9200
  processes = ["app"]

  [[services.ports]]
    port = 9200
    handlers = ["http"]
    force_https = true

Hi so i uploaded with this toml file and now i am getting this error:


and from postman:

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