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개 답변
0
  • Thank you. It is because I did not write the protocol.

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인

관련 콘텐츠