Skip to content

Commit

Permalink
Allow cors by default
Browse files Browse the repository at this point in the history
  • Loading branch information
sebastianthulin authored Dec 14, 2023
1 parent 0e629c4 commit 2dbe4c5
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions nginx-jelastic.conf
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,18 @@ http {
location / {
root html;
index index.html;

# CORS configuration
if ($http_origin ~* (https://helsingborg\.se)$) {
add_header "Access-Control-Allow-Origin" "$http_origin" always;
add_header "Access-Control-Allow-Methods" "GET, POST, OPTIONS" always;
add_header "Access-Control-Allow-Headers" "DNT,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,Range" always;
add_header "Access-Control-Allow-Credentials" "true" always;
}

if ($request_method = OPTIONS) {
return 204;
}
}

error_page 500 502 503 504 /50x.html;
Expand Down

0 comments on commit 2dbe4c5

Please sign in to comment.