data = "">
ngx.print(data)
ngx.flush(true)
break
end
end
file: close()
--追加渠道信息
local chLen = string.len (ch)
local subLength = chLen+ 7
ngx.print(shortTobytes(subLength))
ngx.print(ch)
ngx.print(shortTobytes(chLen))
ngx.print(magic)
ngx.flush()
server{
listen 9034;
server_name localhost;
rewrite_log on;
##################################################
rewrite ^/(.*)/(.*)$ /?ch=$1&v=$2 break;
##################################################
location / {
add_header Content-Disposition 'attachment; filename=didapinche-$arg_ch-$arg_v.apk';
content_by_lua_file 'ngx_lua_script/apk.lua';
}
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root html;
}
}
[root@zhouyu /usr/local/openresty/nginx]# pmap -d 83806
83806: nginx: worker process
Address Kbytes Mode Offset Device Mapping
0000000000400000 1172 r-x-- 0000000000000000 008:00002 nginx
0000000000725000 100 rw--- 0000000000125000 008:00002 nginx
000000000073e000 132 rw--- 0000000000000000 000:00000 [ anon ]
0000000000b54000 408 rw--- 0000000000000000 000:00000 [ anon ]
0000000000bba000 112560 rw--- 0000000000000000 000:00000 [ anon ]
00000000401c9000 128 rw--- 0000000000000000 000:00000 [ anon ]
0000000040400000 128 rw--- 0000000000000000 000:00000 [ anon ]
00000000410ba000 128 rw--- 0000000000000000 000:00000 [ anon ]
0000003478600000 40 r-x-- 0000000000000000 008:00002 libkrb5support.so.0.1
000000347860a000 2044 ----- 000000000000a000 008:00002 libkrb5support.so.0.1
0000003478809000 4 r---- 0000000000009000 008:00002 libkrb5support.so.0.1
000000347880a000 4 rw--- 000000000000a000 008:00002 libkrb5support.so.0.1
0000003478a00000 164 r-x-- 0000000000000000 008:00002 libk5crypto.so.3.1
0000003478a29000 2048 ----- 0000000000029000 008:00002 libk5crypto.so.3.1
0000003478c29000 4 r---- 0000000000029000 008:00002 libk5crypto.so.3.1
0000003478c2a000 4 rw--- 000000000002a000 008:00002 libk5crypto.so.3.1
0000003478c2b000 4 rw--- 0000000000000000 000:00000 [ anon ]
0000003478e00000 876 r-x-- 0000000000000000 008:00002 libkrb5.so.3.3
0000003478edb000 2044 ----- 00000000000db000 008:00002 libkrb5.so.3.3
00000034790da000 40 r---- 00000000000da000 008:00002 libkrb5.so.3.3
00000034790e4000 8 rw--- 00000000000e4000 008:00002 libkrb5.so.3.3