Error when login into ghost

If I try to login into ghost admin page, I get a 403 Forbidden. Simply by going into the website you will see these errors under the chrome dev tools when the frontend tries to access the api. I am using an AWS EC2 instance with cloudfront. I have a certificate within the box with nginx serving the data and another certificate in the AWS Cloudfront distribution.

I also get an error when runing the command ghost backup, log:

? **Enter your Ghost administrator email address** ***@****.***
? **Enter your Ghost administrator password** *[hidden]*
✖ Backing up site
An error occurred.

Message: 'EACCES: permission denied, open '/var/www/ghost/backup/content-from-v5.80.0-on-2024-03-06-12-57-15.json''

When runing ghost doctor all seems to be ok.


OS: Ubuntu, v20.04.6 LTS
Node Version: v18.17.1
Ghost Version: 5.80.0
Ghost-CLI Version: 1.25.3
Mysql Ver 8.0.36-0ubuntu0.20.04.1 for Linux on x86_64 ((Ubuntu))

403 responses are currently expected/valid as they indicate a request isn’t authenticated (e.g. when the comments block on the front-end makes an API request to checks if you’re authenticated as a Staff User, or when you open the Admin app and it makes an API request to see if you’re already authenticated) and generally aren’t anything to be concerned about. Are you experiencing problems trying to use your site?

Just found the issue. AWS CF was not forwarding cookies to ghost. You need to enable the setting in CloudFront Behaviours