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;