hynky HF staff commited on
Commit
143296e
·
1 Parent(s): 0e7b14e
Files changed (1) hide show
  1. nginx.conf +13 -0
nginx.conf CHANGED
@@ -26,6 +26,19 @@ http {
26
 
27
  location / {
28
  try_files $uri $uri/ /index.html;
 
 
 
 
 
 
 
 
 
 
 
 
 
29
  }
30
  }
31
  }
 
26
 
27
  location / {
28
  try_files $uri $uri/ /index.html;
29
+
30
+ # Add CORS headers
31
+ add_header 'Access-Control-Allow-Origin' 'https://huggingface.co' always;
32
+ add_header 'Access-Control-Allow-Methods' 'GET, POST, OPTIONS' always;
33
+ add_header 'Access-Control-Allow-Headers' 'DNT,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,Range' always;
34
+ add_header 'Access-Control-Expose-Headers' 'Content-Length,Content-Range' always;
35
+
36
+ if ($request_method = 'OPTIONS') {
37
+ add_header 'Access-Control-Max-Age' 1728000;
38
+ add_header 'Content-Type' 'text/plain; charset=utf-8';
39
+ add_header 'Content-Length' 0;
40
+ return 204;
41
+ }
42
  }
43
  }
44
  }