Lua > OpenResty HelloWorld
Lua > OpenResty HelloWorld
参考 https://www.bilibili.com/video/BV12i4y1L7As/
mkdir hello
cd hello
mkdir conf logs
vim conf/nginx.conf
worker_processes 1;events {worker_connections 1024;
}http {server {listen 8888 reuseport;location / {default_type text/plain;content_by_lua_block { ngx.say("Hello World") }}}
}
tree
.
├── conf
│ └── nginx.conf
└── logs
nginx -p ./ -t
nginx -p ./
ps aux | grep nginx
curl 'http://127.0.0.1:8888'
Hello World