I am trying to implement an HTTP service and leverage the “fly-replay” header, to select a specific machine to process the request.
When I run the following command:
curl -H "Fly-Replay: instance=e824510b7025a9" https://my-service.fly.dev
I receive a response from the server, but the machine selection is not performed:
I have checked the incoming headers to the service, and it correctly receives the header. However, comparing the FLY_MACHINE_ID in the environment variables, sometimes it matches, and sometimes it does not, proving that no machine selection request is being handled. I tried entering incorrect values, e.g., non-existent machines, and I do not receive any error.
I have tried with lowercase “fly-replay” with the same result
Here is the fly.toml:
app = 'my-service'
primary_region = 'iad'
[build]
[http_service]
auto_start_machines = true
auto_stop_machines = true
force_https = true
internal_port = 3000
min_machines_running = 0
processes = ['app']
[[vm]]
cpu_kind = 'shared'
cpus = 1
memory_mb = 1024