diff --git a/sites-available/elastic.kevinmidboe.conf b/sites-available/elastic.kevinmidboe.conf index b3af132..bbae291 100644 --- a/sites-available/elastic.kevinmidboe.conf +++ b/sites-available/elastic.kevinmidboe.conf @@ -39,12 +39,14 @@ server { add_header 'Content-Length' 0; return 204; } + if ($request_method = 'GET') { add_header 'Access-Control-Allow-Origin' 'https://kevinmidboe.com'; 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 = 'POST') { add_header 'Access-Control-Allow-Origin' 'https://kevinmidboe.com'; add_header 'Access-Control-Allow-Methods' 'GET, POST, OPTIONS';