complete download image (#15)
This commit is contained in:
@@ -33,6 +33,29 @@ server {
|
||||
location /api/ngx/image/combine {
|
||||
content_by_lua_file /usr/local/openresty/resty_funcs/combine.lua;
|
||||
}
|
||||
#Static file server
|
||||
location /file_upload {
|
||||
default_type "";
|
||||
alias /file_upload/;
|
||||
autoindex on;
|
||||
autoindex_exact_size off;
|
||||
autoindex_localtime on;
|
||||
}
|
||||
#Download image files
|
||||
location /download_image {
|
||||
rewrite_by_lua_block{
|
||||
-- Get download image id
|
||||
local download_image_id = string.match(ngx.var.request_uri, ".*/(.*)$")
|
||||
ngx.log(ngx.INFO , "Download image id: " .. download_image_id)
|
||||
|
||||
-- Set redirect uri
|
||||
--local uri = "/internal_file_upload/" .. download_image_id .. ".jpg"
|
||||
--return ngx.exec(uri)
|
||||
|
||||
local uri = "/file_upload/" .. download_image_id .. ".jpg"
|
||||
return ngx.exec(uri, {a = download_image_id})
|
||||
}
|
||||
}
|
||||
|
||||
location /api/v1/ws/ {
|
||||
proxy_pass http://127.0.0.1:3001/api/v1/ws/;
|
||||
|
||||
Reference in New Issue
Block a user