diff --git a/default.conf b/default.conf index d82e8c3..4dfbbb9 100644 --- a/default.conf +++ b/default.conf @@ -21,6 +21,15 @@ server { } location /answer/ { + if ($request_method = OPTIONS) { + add_header Access-Control-Allow-Origin $http_origin always; + add_header Access-Control-Allow-Credentials true always; + add_header Access-Control-Allow-Headers content-type,x-sessionkey always; + add_header Access-Control-Expose-Headers x-sessionkey always; + add_header Access-Control-Allow-Methods OPTIONS,GET,POST,PATCH,PUT,DELETE; + return 200; + } + add_header Access-Control-Allow-Origin $http_origin always; add_header Access-Control-Allow-Credentials true always; add_header Access-Control-Allow-Headers content-type,x-sessionkey always;