ยฉ 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
Cloudflare DevelopersCD
Cloudflare Developersโ€ข2y agoโ€ข
2 replies
Yogi

Help!!!! FastAPI uvicorn app behind Cloudflare proxy

Hi
I have a fast api uvicorn app running behind an nginx on a GCP VM with statis IP.
I am using CloudFlare as my DNS. I have 2 records.
1. The first record DOES NOT use Cloudflare proxy. I am correctly able to make Rest calls to the FastAPI server using both http and https
2. The second record has Cloudflare proxy enabled. When trying to call the rest api now, I get "Bad Gateway Error".

Does anyone know what special configuration do I need to do for Uvicorn, Nginx, FastAPI, or Cloudflare to prevent this error. I would obviously like to use Cloudflare proxy for additional security and performance benefits it provides.
Cloudflare Developers banner
Cloudflare DevelopersJoin
Welcome to the official Cloudflare Developers server. Here you can ask for help and stay updated with the latest news
85,042Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

Bitwarden Behind Proxy
Cloudflare DevelopersCDCloudflare Developers / general-help
3mo ago
Cloudflare pages app behind ZeroTrust/Access
Cloudflare DevelopersCDCloudflare Developers / general-help
2y ago
SSE / Event Streaming wont work behind Cloudflare Proxy
Cloudflare DevelopersCDCloudflare Developers / general-help
15mo ago
Cloudflare proxy
Cloudflare DevelopersCDCloudflare Developers / general-help
3mo ago