diff --git a/docker/nginx/conf.d/cors.conf b/docker/nginx/conf.d/cors.conf new file mode 100644 index 00000000..7fbce3ba --- /dev/null +++ b/docker/nginx/conf.d/cors.conf @@ -0,0 +1,4 @@ +more_set_headers 'Access-Control-Allow-Origin: *'; +more_set_headers 'Access-Control-Allow-Methods: GET, POST, OPTIONS, PUT, DELETE'; +more_set_headers 'Access-Control-Allow-Headers: DNT,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,Range'; +more_set_headers 'Access-Control-Expose-Headers: Content-Length,Content-Range'; \ No newline at end of file diff --git a/docker/nginx/conf.d/include/cors b/docker/nginx/conf.d/include/cors index 33bd2050..fef6d135 100644 --- a/docker/nginx/conf.d/include/cors +++ b/docker/nginx/conf.d/include/cors @@ -12,16 +12,4 @@ if ($request_method = 'OPTIONS') { add_header 'Content-Type' 'text/plain; charset=utf-8'; add_header 'Content-Length' 0; return 204; -} -if ($request_method = 'POST') { - add_header 'Access-Control-Allow-Origin' '*'; - add_header 'Access-Control-Allow-Methods' 'GET, POST, 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'; -} -if ($request_method = 'GET') { - add_header 'Access-Control-Allow-Origin' '*'; - add_header 'Access-Control-Allow-Methods' 'GET, POST, 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'; } \ No newline at end of file