Skip to content

Commit d4340ef

Browse files
committed
set token_dict 1m, add error handling of token_file missing
1 parent 4afdffc commit d4340ef

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

files/nginx.conf

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ http {
1818
# this is necessary for us to be able to disable request buffering in all cases
1919
proxy_http_version 1.1;
2020

21-
lua_shared_dict token_dict 5m;
21+
lua_shared_dict token_dict 1m;
2222

2323
# will run before forking out nginx worker processes
2424
init_by_lua_block {
@@ -29,6 +29,8 @@ http {
2929
local data = token_file:read()
3030
ngx.shared.token_dict:set("ecr_token", data)
3131
token_file:close()
32+
else
33+
ngx.log(ngx.ERR, "Failed to open token file: /usr/local/openresty/nginx/token.txt")
3234
end
3335
}
3436

0 commit comments

Comments
 (0)