-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathipfs.v2ex.pro.conf
37 lines (29 loc) · 1.05 KB
/
ipfs.v2ex.pro.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
upstream ipfs_gateway_backend {
server 127.0.0.1:8080;
keepalive 4;
}
server {
listen 80;
listen [::]:80;
listen 443 ssl http2;
listen [::]:443 ssl http2;
include /etc/nginx/ssl/v2ex.pro.conf;
server_name ipfs.v2ex.pro;
access_log /var/log/nginx/ipfs.v2ex.pro.log;
location / {
proxy_cache awesome;
proxy_pass_header Server;
proxy_http_version 1.1;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Scheme $scheme;
proxy_set_header Via "Planetable";
proxy_cache_revalidate on;
proxy_cache_use_stale error timeout invalid_header updating http_500 http_502 http_503 http_504;
proxy_cache_valid 200 60s;
proxy_cache_background_update on;
add_header CDN-Cache-Control "public, max-age=60, stale-while-revalidate=8640000";
add_header Cache-Control "public, max-age=600, stale-while-revalidate=8640000";
proxy_pass http://ipfs_gateway_backend;
}
}