본문 바로가기
Q&A해결2026년 7월 25일2분 읽기

브라우저에서 S3로 직접 presigned URL 업로드하는데 CORS preflight에서 막혀요

s
s3_dahye
조회 631댓글 2

프론트(리액트)에서 파일을 서버 안 거치고 S3로 바로 올리려고 백엔드에서 presigned PUT URL 받아서 fetch로 PUT 하는 구조입니다. 로컬에서 curl로 그 URL에 PUT 하면 잘 올라가는데, 브라우저에서 하면 OPTIONS 요청부터 막히고 콘솔에 CORS 에러가 뜹니다.

Access to fetch at 'https://my-bucket.s3.ap-northeast-2.amazonaws.com/...'
from origin 'https://app.example.com' has been blocked by CORS policy:
Response to preflight request doesn't pass access control check:
No 'Access-Control-Allow-Origin' header is present on the requested resource.

버킷 정책이랑 IAM은 서버가 URL 잘 만들어주는 거 보면 문제 없는 것 같은데, 브라우저에서만 이러니 어디를 봐야 할지 모르겠어요.

댓글 0

아직 댓글이 없습니다.
Ctrl+Enter로 등록