Lua > OpenResty HelloWorld

Lua > OpenResty HelloWorld

参考 https://www.bilibili.com/video/BV12i4y1L7As/

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

相关推荐
Mr. Cao code7 小时前
探索OpenResty:高性能Web开发利器
linux·运维·服务器·前端·nginx·ubuntu·openresty
测试界清流9 小时前
postman接口功能测试
开发语言·lua
lanhuazui101 天前
lua中table键类型及lua中table的初始化有几种方式
lua
程序猿多布2 天前
Lua和C#比较
c#·lua
我发在否2 天前
Lua > Mac Mini M4安装openresty
macos·lua·openresty
Aiah.2 天前
大彩串口屏-烧录与调试
lua·大彩串口屏·ui显示
程序猿多布2 天前
Lua 面向对象编程
lua
qyvlik2 天前
MacOS 使用 luarocks+wrk+luajit
macos·lua·wrk