Question

Accessing Connecting Public Client IP in App Platform

Hi Community, I’m trying to deploy my Flask API project on App Platform. It was going smoothly but the IP whitelist in the code couldn’t find the connecting public IP of the client in the request headers. I’ve tried the following headers with no luck:

X-Forwarded-For
HTTP_DO_CONNECTING_IP
DO_CONNECTING_IP

These all contained a IPV6 address that must be coming from some middleware or reverse proxy. Is there a way I can see the client IP so I can apply my whitelist? Failing that, is there an alternative to secure my app from the general public?


Submit an answer


This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

Sign In or Sign Up to Answer

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Bobby Iliev
Site Moderator
Site Moderator badge
January 23, 2025

Hey @Shookshank,

I don’t think this is available out of the box, but it looks like someone else had a similar idea and posted it on the DigitalOcean Product Ideas board. The best thing to do would be to head over and add your vote, as well as leave any additional comments about what you’d like to see implemented!

https://ideas.digitalocean.com/app-platform/p/restrict-access-to-app-platform-apps-via-a-trusted-sources-list

In the meantime, you could restrict access by adding authentication at the application level. For example, you could use an API key or token-based system to ensure only trusted clients can connect.

One option here is also to reach out ot the DigitalOcean support team to see if they could help out in the meantime: https://do.co/support

Hope that helps!

- Bobby

Become a contributor for community

Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.

DigitalOcean Documentation

Full documentation for every DigitalOcean product.

Resources for startups and SMBs

The Wave has everything you need to know about building a business, from raising funding to marketing your product.

Get our newsletter

Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.

New accounts only. By submitting your email you agree to our Privacy Policy

The developer cloud

Scale up as you grow — whether you're running one virtual machine or ten thousand.

Get started for free

Sign up and get $200 in credit for your first 60 days with DigitalOcean.*

*This promotional offer applies to new accounts only.