Skip to content

Instantly share code, notes, and snippets.

@toamitkumar
Last active March 29, 2018 08:04
Show Gist options
  • Save toamitkumar/814dbfc9969597a4553dc9d3a6c876c7 to your computer and use it in GitHub Desktop.
Save toamitkumar/814dbfc9969597a4553dc9d3a6c876c7 to your computer and use it in GitHub Desktop.

Revisions

  1. toamitkumar revised this gist Mar 29, 2018. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion gistfile1.txt
    Original file line number Diff line number Diff line change
    @@ -16,7 +16,7 @@ location ~ /api/v1/cards/(\w+)/(\w+) {
    try_files $uri.json
    }

    location ~ /api/v1/cards/(\w+)/(\w+),(\w+) {
    location ~ /api/v1/cards/(\w+)/(\w+)\,(\w+) {
    if ($request_method = OPTIONS ) {
    add_header 'Access-Control-Allow-Origin' '*';
    add_header 'Access-Control-Allow-Methods' 'GET, OPTIONS';
  2. toamitkumar created this gist Mar 29, 2018.
    36 changes: 36 additions & 0 deletions gistfile1.txt
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,36 @@
    location ~ /api/v1/cards/(\w+)/(\w+) {
    if ($request_method = OPTIONS ) {
    add_header 'Access-Control-Allow-Origin' '*';
    add_header 'Access-Control-Allow-Methods' 'GET, OPTIONS';
    add_header 'Access-Control-Allow-Headers' 'Cache-Control,Content-Type,If-Modified-Since';
    return 204;
    }
    add_header 'Access-Control-Allow-Origin' '*';
    add_header 'Access-Control-Allow-Methods' 'GET, OPTIONS';
    add_header 'Access-Control-Allow-Headers' 'Cache-Control,Content-Type,If-Modified-Since';
    add_header 'Access-Control-Allow-Headers' 'Content-Type,If-Modified-Since';
    add_header 'Cache-Control' 'no-store, no-cache, must-revalidate, proxy-revalidate, max-age=0';
    add_header 'Content-type' 'application/json';
    default_type application/json;

    try_files $uri.json
    }

    location ~ /api/v1/cards/(\w+)/(\w+),(\w+) {
    if ($request_method = OPTIONS ) {
    add_header 'Access-Control-Allow-Origin' '*';
    add_header 'Access-Control-Allow-Methods' 'GET, OPTIONS';
    add_header 'Access-Control-Allow-Headers' 'Cache-Control,Content-Type,If-Modified-Since';
    return 204;
    }
    add_header 'Access-Control-Allow-Origin' '*';
    add_header 'Access-Control-Allow-Methods' 'GET, OPTIONS';
    add_header 'Access-Control-Allow-Headers' 'Cache-Control,Content-Type,If-Modified-Since';
    add_header 'Access-Control-Allow-Headers' 'Content-Type,If-Modified-Since';
    add_header 'Cache-Control' 'no-store, no-cache, must-revalidate, proxy-revalidate, max-age=0';
    add_header 'Content-type' 'application/json';
    default_type application/json;

    try_files /usr/share/nginx/html/telkomsel_d8/sites/default/files/assets/cards/$1/$2_$3.json;
    }