Forbidden error with Cloudfront CDN

Hi,

I am trying to setup a Cloudfront CDN.
However, I get an error as you can see here : https://deya3mlcjkmrf.cloudfront.net/
It seems to be related to hosting software configuration i.e Grav or ServerPilot

I run on nginx (check below), so it can’t be a .htaccess issue.
I suspect ServerPilot and a missing config on it, but i didn’t find anything about it.

Any idea?

My Website config :

EC2 + ServerPilot + PHP7

Amazon Machine Image (AMI)
Ubuntu Server 20.04 LTS (HVM),EBS General Purpose (SSD) Volume Type. 64 bits (x86)

EC2 instance type
t2.micro

Web server
Nginx

✓ I solved this issue ✓

A 403 is being returned, as that request from CloudFront is being made to ec2-13-37-46-163.eu-west-3.compute.amazonaws.com :

52.57.254.217 - - [26/Jul/2021:22:57:40 +0000] "GET /favicon.ico HTTP/1.1" 403 461 "-" "Amazon CloudFront" "46.140.111.92" 340 0.001 "859" "0.000" "ec2-13-37-46-163.eu-west-3.compute.amazonaws.com"

[Mon Jul 26 22:57:40.153019 2021] [access_compat:error] [pid 19703:tid 140447217338112] [client 127.0.0.1:20034] AH01797: client denied by server configuration: /opt/sp/apache/htdocs/favicon.ico

The solution is simply to add ec2-13-37-46-163.eu-west-3.compute.amazonaws.com as a domain to my ServerPilot app.

Capture d’écran 2021-07-27 à 16 19 47

And voilà!