更新时间:2022-12-04 08:29:46
您可以通过 nginx.conf 文件中的 Lua
代码执行 shell 脚本来实现此目的.您需要有 HttpLuaModule 才能执行此操作.
You can execute a shell script via Lua
code from the nginx.conf file to achieve this. You need to have the HttpLuaModule to be able to do this.
这是执行此操作的示例.
Here's an example to do this.
location /my-website {
content_by_lua_block {
os.execute("/bin/myShellScript.sh")
}
}