Lua > OpenResty HelloWorld
bash
mkdir hello
cd hello
mkdir conf logs
vim conf/nginx.conf
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") }
}
}
}
bash
tree
.
├── conf
│ └── nginx.conf
└── logs
bash
nginx -p ./ -t
nginx -p ./
ps aux | grep nginx
curl 'http://127.0.0.1:8888'
Hello World