This repository was archived by the owner on Nov 1, 2018. It is now read-only.
forked from daichirata/gcsproxy
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathnginx.conf
72 lines (62 loc) · 1.89 KB
/
nginx.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
user nginx;
worker_processes 1;
daemon off;
error_log /dev/stdout info;
pid /var/lib/nginx/nginx.pid;
events {
worker_connections 1024;
}
http {
include /etc/nginx/mime.types;
default_type application/octet-stream;
log_format main '$remote_addr - $remote_user [$time_local] "$request" '
'$status $body_bytes_sent "$http_referer" '
'"$http_user_agent" "$http_x_forwarded_for"';
access_log /var/log/nginx/access.log main;
server_tokens off;
gzip on;
gzip_disable "msie6";
gzip_comp_level 6;
gzip_min_length 1100;
gzip_buffers 16 8k;
gzip_proxied any;
gzip_types
text/plain
text/css
text/js
text/xml
text/javascript
application/javascript
application/x-javascript
application/json
application/xml
application/xml+rss;
proxy_cache_path /var/cache/nginx keys_zone=google-cloud-storage:10m inactive=60m;
resolver 8.8.8.8 valid=300s ipv6=off;
resolver_timeout 10s;
upstream google-cloud-storage {
server '127.0.0.1:8888';
keepalive 100;
}
server {
listen 80;
if ( $request_method !~ "GET|HEAD" ) {
return 405;
}
location = / {
rewrite ^.*$ /index.html last;
}
location = /healthz/ {
access_log off;
return 200;
}
location / {
proxy_ignore_headers Expires Cache-Control;
proxy_cache google-cloud-storage;
proxy_cache_key "$host/$proxy_host$uri";
proxy_cache_valid 200 1d;
add_header X-Cache $upstream_cache_status;
proxy_pass http://google-cloud-storage$uri;
}
}
}