- commit
- 13277d0748a571511aca07ead602a59f7d07ca22
- parent
- b4fa74bc211f1bf11d67a5e0620841eeeec1a546
- Author
- Tobias Bengfort <tobias.bengfort@posteo.de>
- Date
- 2020-05-04 17:10
fix CORS
Diffstat
| M | via.nginx | 12 | +++++++----- |
1 files changed, 7 insertions, 5 deletions
diff --git a/via.nginx b/via.nginx
@@ -6,18 +6,20 @@ server {
6 6
7 7 location / {
8 8 # https://enable-cors.org/server_nginx.html
9 -1 add_header 'Access-Control-Allow-Origin' '*';
10 -1 add_header 'Access-Control-Allow-Methods' 'GET, POST, OPTIONS';
11 -1 add_header 'Access-Control-Allow-Headers' 'DNT,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,Range';
12 -1 add_header 'Link' '<https://github.com/xi/via>; rel="help"';
13 -1
14 9 if ($request_method = 'OPTIONS') {
-1 10 add_header 'Access-Control-Allow-Origin' '*';
-1 11 add_header 'Access-Control-Allow-Methods' 'GET, POST, OPTIONS';
-1 12 add_header 'Access-Control-Allow-Headers' 'DNT,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,Range';
15 13 add_header 'Access-Control-Max-Age' 1728000;
16 14 add_header 'Content-Type' 'text/plain; charset=utf-8';
17 15 add_header 'Content-Length' 0;
18 16 return 204;
19 17 }
-1 18 add_header 'Access-Control-Allow-Origin' '*';
-1 19 add_header 'Access-Control-Allow-Methods' 'GET, POST, OPTIONS';
-1 20 add_header 'Access-Control-Allow-Headers' 'DNT,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,Range';
20 21
-1 22 add_header 'Link' '<https://github.com/xi/via>; rel="help"';
21 23 proxy_pass http://localhost:8001;
22 24 proxy_buffering off;
23 25 }