-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathsite.conf
110 lines (80 loc) · 3.27 KB
/
site.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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
proxy_cache_path /var/cache/nginx/cache levels=1:2 keys_zone=share:25m inactive=40000s;
server {
listen 80;
listen [::]:80;
server_name _;
return 301 https://$host$request_uri;
}
server {
listen 443 ssl default_server;
listen [::]:443 ssl default_server;
server_name _;
ssl_certificate /etc/letsencrypt/live/dev-labs.cos.io/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/dev-labs.cos.io/privkey.pem;
proxy_buffering on;
location /bulk_get_agents {
if ($request_method = 'OPTIONS') {
add_header 'Access-Control-Allow-Credentials' 'true';
add_header 'Access-Control-Allow-Methods' 'HEAD, GET, POST, OPTIONS';
add_header 'Access-Control-Allow-Headers' 'DNT,X-Mx-ReqToken,Keep-Alive,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type';
add_header 'Access-Control-Max-Age' 1728000;
add_header 'Content-Type' 'text/plain charset=UTF-8';
add_header 'Content-Length' 0;
return 204;
}
proxy_cache share;
proxy_cache_methods HEAD GET POST;
proxy_cache_key "$host$uri$is_args$args$request_body";
add_header X-Debug-Cache-Key "$uri$request_body";
proxy_ignore_headers Expires Cache-Control Set-Cookie;
proxy_hide_header Set-Cookie;
proxy_hide_header Cache-Control;
proxy_buffers 8 32k;
proxy_buffer_size 64k;
proxy_cache_valid 40000s;
proxy_cache_use_stale updating;
expires max;
proxy_pass http://localhost:9000/;
more_set_headers 'Access-Control-Allow-Origin: $http_origin';
add_header X-Cache $upstream_cache_status;
}
location / {
if ($request_method = 'OPTIONS') {
add_header 'Access-Control-Allow-Credentials' 'true';
add_header 'Access-Control-Allow-Methods' 'HEAD, GET, POST, OPTIONS';
add_header 'Access-Control-Allow-Headers' 'DNT,X-Mx-ReqToken,Keep-Alive,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type';
add_header 'Access-Control-Max-Age' 1728000;
add_header 'Content-Type' 'text/plain charset=UTF-8';
add_header 'Content-Length' 0;
return 204;
}
proxy_cache share;
proxy_cache_methods HEAD GET POST;
proxy_cache_key "$host$uri$is_args$args$request_body";
add_header X-Debug-Cache-Key "$uri$request_body";
proxy_ignore_headers Expires Cache-Control Set-Cookie;
proxy_hide_header Set-Cookie;
proxy_hide_header Cache-Control;
proxy_buffers 8 32k;
proxy_buffer_size 64k;
proxy_cache_valid 40000s;
proxy_cache_use_stale updating;
expires max;
proxy_pass https://share.osf.io;
more_set_headers 'Access-Control-Allow-Origin: $http_origin';
add_header X-Cache $upstream_cache_status;
#proxy_set_header X-Real-IP $remote_addr;
#proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
#proxy_set_header X-Forwarded-Proto https;
#proxy_set_header X-Forwarded-Port 443;
#proxy_set_header Host $host;
}
}
server {
listen 8080;
listen [::]:8080;
server_name _;
location / {
proxy_pass https://share.osf.io;
}
}