Static IP guide
Making API requests with a static IP from a Python app on Fly.io
Python apps on Fly.io route requests through Fixie by reading FIXIE_URL from a Fly secret into a proxies dict — or by exporting http_proxy and https_proxy for zero code changes. Machines may move between hosts and regions; the outbound addresses your partners see will not.
Recommended setup
Use Fixie HTTP/S proxy for HTTP and HTTPS requests to an API, webhook provider, or service that allowlists outbound IP addresses. Store the proxy value in FIXIE_URL, then configure Python to route outbound traffic through Fixie before connecting to API allowlisting.
Set up Fixie on Fly.io
Create a Fixie HTTP/S proxy in the Fixie dashboard. Copy the proxy value into Fly.io secrets as FIXIE_URL, and copy the outbound IPs into the destination allowlist.
Set a Fly.io secret
fly secrets set FIXIE_URL=...Implementation
The example below shows the core application-side change. Keep credentials in environment variables and avoid committing proxy, database, or API secrets.
Make an HTTP request through FIXIE_URL
import os
import requests
proxies = {
"http": os.environ["FIXIE_URL"],
"https": os.environ["FIXIE_URL"],
}
response = requests.get("https://api.example.com/data", proxies=proxies)
print(response.status_code)Good to know
- Store the value with
fly secrets set FIXIE_URL=...rather than infly.toml, which is committed to your repo. - If several Fly apps in one organization call the same allowlisted API, they can share a single Fixie proxy and its IP pair.
Allowlist and test the static IPs
- Open the Fixie dashboard and copy the outbound IP addresses for this proxy.
- Add both IPs to the API provider.
- Deploy the updated Python app on Fly.io.
- Run a small connection test before sending production traffic.
Related guides
- Making API requests with a static IP from a Python app on Heroku
- Making API requests with a static IP from a Node app on Fly.io
- Making API requests with a static IP from a Python app on Vercel
- Making API requests with a static IP from a Go app on Fly.io
- Making API requests with a static IP from a Python app on Render
- Making API requests with a static IP from a Python app on Koyeb