본문 바로가기

Programming/Linux

[Linux] 리눅스 이미지 서버 CORS 세팅하기

728x90
location /images {
        alias 이미지파일 경로;
        add_header 'Access-Control-Allow-Origin' '*';
        add_header 'Access-Control-Allow-Methods' 'GET, OPTIONS';
        add_header 'Access-Control-Allow-Headers' 'DNT,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,Range';
        add_header 'Access-Control-Expose-Headers' 'Content-Length,Content-Range';
    }

안드로이드나 웹에서는 이미지가 정상적으로 불러와지는데 IOS에서 이미지가 불러와지지 않는 경우 해당 header 코드 추가하기!

 

내가 까먹지 않기 위해 기록하기

'Programming > Linux' 카테고리의 다른 글

[Linux] 백그라운드 작업 nohup  (0) 2023.04.21