1. Overview

CORS 설정 방법.



2. Descriptions

1
2
3
4
5
6
7
8
9
10
11
12
13
14
LoadModule headers_module modules/mod_headers.so

# 모든 URL
<IfModule mod_headers.c>
    Header add Access-Control-Allow-Origin *
    Header set Access-Control-Allow-Credentials true
</IfModule>

# 다음 URL
<IfModule mod_headers.c>
    SetEnvIf Origin "http(s)?://(abc|def\.)?(test.com|beta.com)$" AccessControlAllowOrigin=$0$1
    Header add Access-Control-Allow-Origin %{AccessControlAllowOrigin}e env=AccessControlAllowOrigin
    Header set Access-Control-Allow-Credentials true
</IfModule>

다음 URL은

http://abc.test.com

http://abc.beta.com

https://abc.test.com

https://abc.beta.com

http://def.test.com

http://def.beta.com

https://def.test.com

https://def.beta.com