Add lua-resty-core and change upload-path

This commit is contained in:
2019-06-20 15:38:17 +02:00
parent 5f024981b7
commit aa905bff2d
3 changed files with 8 additions and 2 deletions
+3
View File
@@ -17,6 +17,9 @@ RUN wget https://github.com/simpl/ngx_devel_kit/archive/v0.3.0.tar.gz -O ngx_dev
wget https://github.com/openresty/set-misc-nginx-module/archive/v0.32.tar.gz -O set-misc-nginx-module.tar.gz && \ wget https://github.com/openresty/set-misc-nginx-module/archive/v0.32.tar.gz -O set-misc-nginx-module.tar.gz && \
mkdir set-misc-nginx-module && \ mkdir set-misc-nginx-module && \
tar xf set-misc-nginx-module.tar.gz -C set-misc-nginx-module --strip-components=1 && \ tar xf set-misc-nginx-module.tar.gz -C set-misc-nginx-module --strip-components=1 && \
wget https://github.com/openresty/lua-resty-core/archive/v0.1.17.tar.gz -O lua-resty-core.tar.gz && \
mkdir lua-resty-core && \
tar xf lua-resty-core.tar.gz -C lua-resty-core --strip-components=1 && \
wget https://github.com/openresty/lua-nginx-module/archive/v0.10.15.tar.gz -O lua-nginx-module.tar.gz && \ wget https://github.com/openresty/lua-nginx-module/archive/v0.10.15.tar.gz -O lua-nginx-module.tar.gz && \
mkdir lua-nginx-module && \ mkdir lua-nginx-module && \
tar xf lua-nginx-module.tar.gz -C lua-nginx-module --strip-components=1 && \ tar xf lua-nginx-module.tar.gz -C lua-nginx-module --strip-components=1 && \
+1 -1
View File
@@ -17,7 +17,7 @@ Environment variables are used to provide configuration.
Try it out: Try it out:
curl localhost:8000/upload -d 'some data' -v curl localhost:8000/ -d 'some data' -v
... ...
> PUT /uploads HTTP/1.1 > PUT /uploads HTTP/1.1
... ...
+4 -1
View File
@@ -9,6 +9,9 @@ events {
} }
http { http {
lua_load_resty_core off;
lua_package_path "/tmp/lua-resty-core/lib/?.lua;;";
server { server {
listen 80; listen 80;
client_max_body_size 0; client_max_body_size 0;
@@ -19,7 +22,7 @@ http {
access_log off; access_log off;
} }
location ~* ^/uploads { location ~* ^/ {
if ($request_method = 'OPTIONS') { if ($request_method = 'OPTIONS') {
# Tell client that this pre-flight info is valid for 20 days # Tell client that this pre-flight info is valid for 20 days
add_header 'Access-Control-Allow-Origin' "*" ; add_header 'Access-Control-Allow-Origin' "*" ;