Skip to content

Commit 71aed48

Browse files
change path for lua code,
from now on root / - html in /html - conf in /conf - lua in /lua
1 parent e5aadcb commit 71aed48

File tree

4 files changed

+9
-9
lines changed

4 files changed

+9
-9
lines changed

docker-compose.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ services:
7777
# volumes:
7878
# - "./openresty/nginx:/usr/local/openresty/nginx/conf"
7979
# - "./openresty/html:/usr/local/openresty/nginx/html"
80-
# - "./openresty/lua:/usr/local/openresty/lualib/user_code"
80+
# - "./openresty/lua:/usr/local/openresty/nginx/lua"
8181
# depends_on:
8282
# - db
8383

openresty/Dockerfile

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
FROM openresty/openresty:stretch
22

33
COPY nginx /usr/local/openresty/nginx/conf
4-
COPY html /usr/local/openresty/nginx
5-
COPY lua /usr/local/openresty/lualib/user_code
4+
COPY html /usr/local/openresty/nginx/html
5+
COPY lua /usr/local/openresty/nginx/lua

openresty/nginx/nginx.conf

+2-2
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@ events {
1818
http {
1919

2020
# set search paths for pure Lua external libraries (';;' is the default path):
21-
lua_package_path '${prefix}../lualib/user_code/?.lua;;';
22-
init_by_lua_file '../lualib/user_code/init_phase.lua';
21+
lua_package_path '${prefix}lua/?.lua;;';
22+
init_by_lua_file 'lua/init_phase.lua';
2323

2424
# a shorter log format for development
2525
log_format development '[$time_local] "$request" $status $body_bytes_sent "$request_time ms"';

openresty/nginx/rest.conf

+4-4
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ set $rest_prefix "/api";
44
location /api/rpc/refresh_token {
55
if ($cookie_REFRESHTOKEN != ""){
66
more_set_input_headers 'Refresh-Token: $cookie_REFRESHTOKEN';
7-
rewrite_body_with_refresh_token '../lualib/user_code/internal_rest_refresh_token.lua';
7+
rewrite_body_with_refresh_token 'lua/internal_rest_refresh_token.lua';
88
}
99

1010
rewrite ^/api/(.*)$ /internal/api/$1;
@@ -26,9 +26,9 @@ location /internal/api/ {
2626
internal;
2727
default_type application/json;
2828

29-
rewrite_by_lua_file '../lualib/user_code/internal_rest_rewrite_phase.lua';
30-
header_filter_by_lua_file '../lualib/user_code/internal_rest_header_filter_phase.lua';
31-
body_filter_by_lua_file '../lualib/user_code/internal_rest_body_filter_phase.lua';
29+
rewrite_by_lua_file 'lua/internal_rest_rewrite_phase.lua';
30+
header_filter_by_lua_file 'lua/internal_rest_header_filter_phase.lua';
31+
body_filter_by_lua_file 'lua/internal_rest_body_filter_phase.lua';
3232

3333
proxy_set_header Accept-Encoding ""; #force postgrest not to gzip the output
3434
proxy_set_header Connection ""; #optimise communication with upstream (keep alive)

0 commit comments

Comments
 (0)