Cloudfront S3 origin response 403 for the Options request

0

I'm using cloudfront with s3 origin.

I do not understand why cloudfront respond with 403 error for the Options preflight request.

S3 cors settings:

[
    {
        "AllowedHeaders": [
            "*"
        ],
        "AllowedMethods": [
            "GET",
            "HEAD"
        ],
        "AllowedOrigins": [
            "mydomain1.com",
            "mydomain2.com"
        ],
        "ExposeHeaders": [],
        "MaxAgeSeconds": 0
    }
]

cloudfront request origin policy:

(include below headers)
Origin
Access-Control-Request-Method
Access-Control-Request-Headers

My cloudfront distributions's behavior also allow OPTIONS method. But I do not know why I get 403 error http status code with below response headers:

access-control-allow-headers: *
access-control-allow-methods: GET,HEAD
access-control-allow-origin: https://mydomain1.com
vary: Access-Control-Request-Method
vary: Origin
vary: Access-Control-Request-Headers
x-cache: Error from cloudfront
1 Antwort
0
Akzeptierte Antwort
profile pictureAWS
beantwortet vor 2 Jahren
profile picture
EXPERTE
überprüft vor 10 Monaten
  • Thank you. It is because I did not write the protocol.

Du bist nicht angemeldet. Anmelden um eine Antwort zu veröffentlichen.

Eine gute Antwort beantwortet die Frage klar, gibt konstruktives Feedback und fördert die berufliche Weiterentwicklung des Fragenstellers.

Richtlinien für die Beantwortung von Fragen