This commit is contained in:
2021-08-28 22:01:00 +08:00
parent 2737641454
commit 6c9e6bd1ec
2 changed files with 88 additions and 0 deletions
+33
View File
@@ -0,0 +1,33 @@
put `upload.lua` into:
```bash
/usr/local/opt/openresty/nginx/resty_funcs
```
post file:
```bash
$ curl --location --request POST 'localhost/upload' \
--form '=@"/Users/weli/works/task_server/src/test/resources/file_example_JPG_100kB.jpeg"'
```
nginx config
```
/usr/local/etc/openresty/nginx.conf
```
```
location /upload {
content_by_lua_file /usr/local/opt/openresty/nginx/resty_funcs/upload.lua;
}
```
enable log:
```
error_log /usr/local/etc/openresty/logs/error.log;
```