Our web service is running on EC2 with Apache. We have the following setup:
Service A -> ELB -> Service B API
In this case, Apache on Service B shows in rewrite.log that the rewrite rule was matched and responds with 200 OK.
However, when we access the same endpoint through CloudFront:
Service A -> CloudFront -> ELB -> Service B API
Then Apache on Service B still shows in rewrite.log that the same rewrite rule was matched, but Apache responds with 404 Not Found, even though the corresponding PHP file exists
Does anyone know what could cause this behavior?
I suspect it might be related to headers or URL rewriting when requests come through CloudFront, but I’m not sure.