forked from greatbit/quack
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathquack-cors.conf
44 lines (35 loc) · 1.6 KB
/
quack-cors.conf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
server {
add_header 'Access-Control-Allow-Origin' 'http://localhost:3000' always;
add_header 'Access-Control-Allow-Credentials' 'true' always;
listen [::]:81;
listen 81 default_server;
proxy_read_timeout 300;
proxy_connect_timeout 300;
proxy_http_version 1.1;
proxy_set_header Host $host;
access_log /var/log/nginx/access.log;
error_log /var/log/nginx/error.log;
location / {
add_header 'Access-Control-Allow-Origin' 'http://localhost:3000' always;
add_header 'Access-Control-Allow-Credentials' 'true' always;
try_files $uri /index.html =404;
}
location /api {
proxy_pass http://localhost:8080/api;
access_log /var/log/nginx/access.log;
error_log /var/log/nginx/error.log;
proxy_redirect off;
proxy_connect_timeout 60s;
add_header Access-Control-Allow-Methods "GET,PUT,OPTIONS,POST,DELETE";
add_header 'Access-Control-Allow-Origin' 'http://localhost:3000' always;
add_header 'Access-Control-Allow-Credentials' 'true' always;
add_header Access-Control-Allow-Headers "Content-Type";
add_header Access-Control-Max-Age "86400";
}
location = /favicon.ico {
add_header 'Access-Control-Allow-Origin' 'http://localhost:3000' always;
add_header 'Access-Control-Allow-Credentials' 'true' always;
log_not_found off;
access_log off;
}
}