Problem Description
Hello, I'm facing an issue related to the WAF configuration in Cloudflare when my PHP application on AWS Elastic Beanstalk tries to make calls to a specific endpoint. I am using Elastic Beanstalk on AWS and have moved my DNS configuration to Cloudflare.
Current Configuration
- PHP application on AWS Elastic Beanstalk:
mysite.mydomain.com
- Internal endpoints, such as:
mysite.mydomain.com/loginValidation.php
- Dynamic public IP of the EC2 machine:
18.X.X.34
- Elastic Load Balancer (ELB) in AWS pointing to the EC2 machine
- DNS configuration in Cloudflare with a CNAME pointing to ELB:
mysite --> awseb-AWSEB-XXXXXXX.eu-central-1.elb.amazonaws.com
Everything is working as expected so far.
The Issue
When my application tries to access the endpoint mysite.mydomain.com/loginValidation.php
, Cloudflare's WAF blocks the request, showing the following details in the firewall:
- IP Address:
18.X.X.34
(IP of the EC2 machine) - Country: "Country of AWS region"
- Action: Blocked
What I've Tried
I've tried to solve this problem by temporarily allowing the dynamic public IP 18.X.X.34
in Cloudflare's WAF, but this is just a temporary fix.
Question
How can I correctly configure Cloudflare so that it does not block internal calls made from my own domain or load balancer in AWS Elastic Beanstalk? Or even make changes on my code when calling loginValidation.php
?
Thanks
Thank you very much for taking the time to read through my issue and provide any guidance.