From aa905bff2d73165554fc289b9cdfb23cbc5c72bb Mon Sep 17 00:00:00 2001 From: Joakim Olsson Date: Thu, 20 Jun 2019 15:38:17 +0200 Subject: [PATCH] Add lua-resty-core and change upload-path --- Dockerfile | 3 +++ README.MD | 2 +- nginx.conf | 5 ++++- 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index ef5f3f6..e68ace2 100644 --- a/Dockerfile +++ b/Dockerfile @@ -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 && \ mkdir set-misc-nginx-module && \ 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 && \ mkdir lua-nginx-module && \ tar xf lua-nginx-module.tar.gz -C lua-nginx-module --strip-components=1 && \ diff --git a/README.MD b/README.MD index e3fdd61..fac780d 100644 --- a/README.MD +++ b/README.MD @@ -17,7 +17,7 @@ Environment variables are used to provide configuration. Try it out: - curl localhost:8000/upload -d 'some data' -v + curl localhost:8000/ -d 'some data' -v ... > PUT /uploads HTTP/1.1 ... diff --git a/nginx.conf b/nginx.conf index beeb6e5..427294b 100644 --- a/nginx.conf +++ b/nginx.conf @@ -9,6 +9,9 @@ events { } http { + lua_load_resty_core off; + lua_package_path "/tmp/lua-resty-core/lib/?.lua;;"; + server { listen 80; client_max_body_size 0; @@ -19,7 +22,7 @@ http { access_log off; } - location ~* ^/uploads { + location ~* ^/ { if ($request_method = 'OPTIONS') { # Tell client that this pre-flight info is valid for 20 days add_header 'Access-Control-Allow-Origin' "*" ;