-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathnginx-default
54 lines (43 loc) · 1.32 KB
/
nginx-default
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
# Cache setup
proxy_cache_path /tmp/cache/nginx levels=1:2 keys_zone=fragments-cache:100m max_size=50000m inactive=600m;
proxy_temp_path /tmp/nginx;
upstream fragments-node {
server 10.0.0.218:3002;
#server 172.18.16.128:3002;
}
server {
listen 3001 default_server;
server_name server;
if ($request_method !~ ^(GET|HEAD|OPTIONS)$) {
return 405;
}
# Google site verification
location ~ ^/(google[a-z0-9]*\.html)$ {
alias /www/$1;
}
location /assets/ {
proxy_pass http://fragments-node$request_uri;
proxy_pass_header Server;
expires 3w;
proxy_cache fragments-cache;
proxy_cache_key "$request_uri";
proxy_cache_valid 200 404 60m;
proxy_cache_bypass $arg_nocache $http_pragma;
}
location /logs {
alias /data/log/nginx/public;
autoindex on;
autoindex_exact_size off;
autoindex_localtime on;
}
location / {
proxy_pass http://fragments-node$request_uri;
proxy_set_header Host $http_host;
proxy_pass_header Server;
expires 7d;
proxy_cache fragments-cache;
proxy_cache_key "$request_uri $http_accept";
proxy_cache_valid 200 302 404 60m;
proxy_cache_bypass $arg_nocache $http_pragma;
}
}