Skip to content

Commit

Permalink
openresty
Browse files Browse the repository at this point in the history
Signed-off-by: hunkier <[email protected]>
  • Loading branch information
hunkier committed May 27, 2021
1 parent a4b94ba commit 65e4b60
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 2 deletions.
6 changes: 5 additions & 1 deletion openresty/conf/nginx.conf
Original file line number Diff line number Diff line change
@@ -1,12 +1,16 @@
worker_processes 2;
error_log logs/error.log info;
pid logs/openresty.pid;
events {
worker_connections 1024;
}
http {
default_type application/octet-stream;
access_log logs/access.log;
lua_package_path 'src/?.lua;;';
# $prefix就是启动参数中的 -p PATH;
# /lua/?.lua表示 lua 目录下所有以 .lua 作为后缀的文件;
# 最后的两个分号,则代表内置的代码搜索路径。
lua_package_path '$prefix/src/?.lua;;';
# lua 代码热加载,线上应该关闭该功能,影响性能
lua_code_cache off;
server {
Expand Down
2 changes: 2 additions & 0 deletions openresty/openresty-reload.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#openresty -s quit -p `pwd` -c conf/nginx.conf
openresty -p `pwd` -c conf/nginx.conf -s reload
2 changes: 2 additions & 0 deletions openresty/openresty-stop.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#openresty -s quit -p `pwd` -c conf/nginx.conf
openresty -p `pwd` -c conf/nginx.conf -s quit
2 changes: 2 additions & 0 deletions openresty/openresty.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#openresty -s quit -p `pwd` -c conf/nginx.conf
openresty -p `pwd` -c conf/nginx.conf
2 changes: 1 addition & 1 deletion openresty/src/test.lua
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
local function main()
ngx.say("hello world, i am a test aaaaa")
ngx.say("hello world, i am a test aaaaa1")
end
main()

Expand Down

0 comments on commit 65e4b60

Please sign in to comment.