Request headers are missing from fetch requests

I have a fly apps v2 app running on machines, and I’m using node-fetch to make a request to a 3rd party API.

The 3rd party needs to whitelist our connection via an IP address before it will allow us to connect, however, Fly is not adding the request headers (e.g. Fly-Client-IP or X-Forwarded-For) to my request for some reason.

Everything in the docs makes it seem like they should just be added, so I’m not sure why they aren’t there. Is there something I have to do to enable them? Is there a way to add this header manually?


Since that request would be made from your app to the third-party, you could indeed manually add whatever headers you like to the request. Like when calling an external API, you might send an Authorization header.

However those Fly-added headers would be for ones that come in, routed via its proxy. For example if you request that would hit Fly’s proxy, and then on to the app. You’ll see on screen (or in the network tab) the headers. Sure enough, there is a Fly-Client-IP (etc).

The problem you may face here is that Fly don’t provide an official way to get a fixed outgoing IP for you to whitelist. For example see:

1 Like

Ah okay, I see, thank you :slight_smile:

1 Like

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