-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathnginx.conf
More file actions
89 lines (73 loc) · 2.42 KB
/
nginx.conf
File metadata and controls
89 lines (73 loc) · 2.42 KB
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
daemon off;
worker_processes auto;
events {
worker_connections 1024;
use epoll;
multi_accept on;
}
http {
log_format logstash_json escape=json '{'
'"agent": "$http_user_agent", '
'"body_bytes_sent": "$body_bytes_sent", '
'"bytes_sent": "$bytes_sent", '
'"clientip": "$remote_addr", '
'"http_host": "$http_host", '
'"log_timestamp": "$time_local", '
'"proxy_host": "$proxy_host", '
'"referrer": "$http_referer", '
'"request": "$request", '
'"request_time": $request_time, '
'"request_length": $request_length, '
'"status": $status, '
'"upstream_addr": "$upstream_addr", '
'"upstream_response_time": "$upstream_response_time", '
'"upstream_status": "$upstream_status", '
'"x_forwarded_for": "$http_x_forwarded_for", '
'"x_forwarded_port": "$http_x_forwarded_port", '
'"x_forwarded_proto": "$http_x_forwarded_proto"'
'}';
access_log /var/log/nginx/access.log logstash_json;
gzip on;
gzip_proxied any;
gzip_vary on;
gzip_types application/json application/x-tar;
gzip_min_length 1000;
variables_hash_max_size 1024;
variables_hash_bucket_size 64;
server_names_hash_bucket_size 64;
types_hash_max_size 2048;
types_hash_bucket_size 64;
client_max_body_size 100m;
proxy_read_timeout 60;
proxy_buffers 256 32k;
proxy_busy_buffers_size 64k;
sendfile on;
tcp_nopush on;
tcp_nodelay on;
default_type application/octet-stream;
server {
listen 80 default_server;
listen [::]:80 default_server ipv6only=on;
server_name SERVER_NAME_HERE;
resolver DNS_RESOLVER_HERE valid=30s;
# for elb health checks
location = /status {
return 200 'ok';
}
location ~* ^/(.*) {
set $s3_bucket_endpoint "BUCKET_NAME_HERE";
proxy_http_version 1.1;
proxy_buffering off;
proxy_ignore_headers "Set-Cookie";
proxy_hide_header x-amz-id-2;
proxy_hide_header x-amz-request-id;
proxy_hide_header x-amz-meta-s3cmd-attrs;
proxy_hide_header Set-Cookie;
proxy_set_header Host $s3_bucket_endpoint;
proxy_set_header Authorization "";
proxy_intercept_errors on;
proxy_pass http://$s3_bucket_endpoint/$1;
break;
}
}
}