S3 hosted website with Fastly as CDN

0

Hello! We were previously using Cloudfront as our CDN and decided to move over to Fastly. An issue we are running in to this is that to get the original react application to work on Cloudfront we had to set a custom error response in Cloudfront so 403's are redirected back to a 200 status which seems to assist in react paths upon reload or loading directly. I am wondering if there are headers that need to be set by the requester which I do not know about aside from same origin? Thanks so much for your help!

2 réponses
1

Fastly did not have much experience in recreating the custom error response from AWS, so I was a bit on my own with this but this is what I came up with that recreates the same behavior. Add a VCL snippet under the vcl_fetch subroutine and this will recreate the desired behavior: if (beresp.status == 403) { set req.url = "/index.html"; set beresp.status = 200; return (restart); }

Hopefully this helps someone else out in the future!!

répondu il y a un an
0

I would reach out the Fastly support team, as the answer depends on some of the Fastly CDN settings which have been applied.

AWS
répondu il y a un an

Vous n'êtes pas connecté. Se connecter pour publier une réponse.

Une bonne réponse répond clairement à la question, contient des commentaires constructifs et encourage le développement professionnel de la personne qui pose la question.

Instructions pour répondre aux questions