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

相关推荐
上海合宙LuatOS7 小时前
LuatOS扩展库API——【exremotefile】远程文件管理系统
物联网·lua·luatos
上海合宙LuatOS9 小时前
LuatOS扩展库API——【exremotecam】网络摄像头控制
开发语言·网络·物联网·lua·luatos
专吃海绵宝宝菠萝屋的派大星1 天前
使用postman测试自己编写的mcp服务
测试工具·lua·postman
一个有温度的技术博主1 天前
Lua语法详解:从变量声明到循环遍历的避坑指南
redis·缓存·lua
上海合宙LuatOS1 天前
LuatOS扩展库API——【exmodbus】MODBUS协议
物联网·lua·luatos
一个有温度的技术博主1 天前
Lua语法进阶:函数封装与条件控制的艺术
redis·分布式·缓存·lua
夜影风1 天前
Tengine、OpenResty与Nginx三大Web服务中间件对比分析
nginx·openresty·技术架构
小李云雾3 天前
FastAPI 后端开发:文件上传 + 表单提交
开发语言·python·lua·postman·fastapi
曼巴UE53 天前
Unlua 官方案例
c++·ue5·lua·ue
列星随旋4 天前
基于 Redis + Lua,实现“多维度原子限流”(令牌桶 + 滑动窗口)
java·redis·lua