Skip to content

Instantly share code, notes, and snippets.

@kid
Last active June 13, 2017 08:20
Show Gist options
  • Save kid/99f91c8a22cab5b2ed8d6c790c9e8095 to your computer and use it in GitHub Desktop.
Save kid/99f91c8a22cab5b2ed8d6c790c9e8095 to your computer and use it in GitHub Desktop.
nginx...
location / {
expires $expires;
if ($cors = "simple") {
add_header "Access-Control-Allow-Origin" "$http_origin";
}
if ($cors = "preflight") {
add_header "Access-Control-Allow-Origin" "$http_origin";
add_header "Access-Control-Allow-Methods" "GET, HEAD, POST, OPTIONS";
add_header "Access-Control-Allow-Headers" "Cache-Control";
return 204;
}
try_files $uri /index.html;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment