Why is my request blocked with a 403?

I have an application hosted on Cloudflare Pages with a custom domain. I also have a _worker.js that proxies requests to /api to an external server of ours. We need to make a request to /api at build time in GitHub Actions. When it tries to make this request it gets a 403 response from Cloudflare. The origin server does not receive this request at all, so something is blocking it. (The request works fine when I use curl). I tried to add a WAF exception for this particular endpoint, and the logs say that the request was not blocked, but I'm still getting a 403. Does Cloudflare Pages workers have other rules that might be blocking the request? How can I change those. The response on the client is an HTML page starting with <!DOCTYPE html><html lang="en-US"><head><title>Just a moment...</title><meta http-equiv="Content-Type"
No description
6 Replies
Chaika
Chaika•2w ago
Your config doesn't appear to be mitigating it, could be further down. I'd start with adding logs inside of your Pages Function, and then looking at those logs when you send a request ?pages-logs
SuperHelpflare
SuperHelpflare•2w ago
If you're looking to tail a Pages Function you can do so in the UI here: https://dash.cloudflare.com?to=/:account/pages/view/:pages-project/:pages-deployment/functions or with Wrangler: wrangler pages deployment tail [deploymentId/url]
Ross
RossOP•2w ago
Here is the log for the failing request. I'm still not able to tell why it got a 403 except that it has a bot score of 99. The origin server on EC2 did not receive this request at all. So what could be blocking this request? And how can I allow it through.
jude 🌈
jude 🌈•7d ago
Hi @Leo , I work with Ross. thanks for helping us out Here are the response headers
jude 🌈
jude 🌈•7d ago
thank you, we'll look into that

Did you find this page helpful?