aboutsummaryrefslogtreecommitdiff
path: root/client
diff options
context:
space:
mode:
authorShyam Sunder2019-08-05 17:11:20 -0400
committerShyam Sunder2019-08-05 17:11:20 -0400
commit69922fccb68d65f4cabba03b04bb2c6b7c5acde6 (patch)
treeece94964839d7d0cb40024595275c2e0429cba8d /client
parent9b02a0bd5e38b260d27650aed98360ad5910cfc2 (diff)
client/nginx: enable Cross-Origin Resource Sharing for API calls
Fixes #275
Diffstat (limited to 'client')
-rw-r--r--client/nginx.conf.docker12
1 files changed, 12 insertions, 0 deletions
diff --git a/client/nginx.conf.docker b/client/nginx.conf.docker
index 6d8c9c1..bae19e7 100644
--- a/client/nginx.conf.docker
+++ b/client/nginx.conf.docker
@@ -32,9 +32,19 @@ http {
}
location ~ ^/api/(.*)$ {
+ add_header 'Access-Control-Allow-Origin' '*';
+ if ($request_method = 'OPTIONS') {
+ add_header 'Access-Control-Allow-Methods'
+ 'GET, POST, PUT, DELETE, OPTIONS';
+ add_header 'Access-Control-Allow-Headers'
+ 'Authorization, Content-Type';
+ return 200;
+ }
+
if ($request_uri ~* "/api/(.*)") {
proxy_pass http://backend/$1;
}
+
gzip on;
gzip_comp_level 3;
gzip_min_length 20;
@@ -50,9 +60,11 @@ http {
location / {
root /var/www;
try_files $uri /index.htm;
+
gzip_static on;
gzip_proxied expired no-cache no-store private auth;
}
}
}
+
daemon off;

© 2015 - 2026 Jakob L. Kreuze