-
Notifications
You must be signed in to change notification settings - Fork 250
/
volume
executable file
·66 lines (50 loc) · 1.1 KB
/
volume
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
#!/bin/bash -e
export VOLUME=${1:-/tmp/volume1/}
export TYPE=volume
export PORT=${PORT:-3001}
mkdir -p $VOLUME
chmod 777 $VOLUME
CONF=$(mktemp)
echo "
daemon off; # docker
#worker_rlimit_nofile 100000;
worker_processes auto;
pcre_jit on;
error_log /dev/stderr;
pid $VOLUME/nginx.pid;
events {
#use epoll;
multi_accept on;
accept_mutex off;
worker_connections 4096;
}
http {
sendfile on;
sendfile_max_chunk 1024k;
tcp_nopush on;
tcp_nodelay on;
open_file_cache off;
types_hash_max_size 2048;
server_tokens off;
default_type application/octet-stream;
error_log /dev/stderr error; # docker
server {
listen $PORT default_server backlog=4096;
location / {
root $VOLUME;
disable_symlinks off;
client_body_temp_path $VOLUME/body_temp;
client_max_body_size 0;
# this causes tests to fail
#client_body_buffer_size 0;
dav_methods PUT DELETE;
dav_access group:rw all:r;
create_full_put_path on;
autoindex on;
autoindex_format json;
}
}
}
" > $CONF
echo "starting nginx on $PORT"
nginx -c $CONF -p $VOLUME/tmp