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

相关推荐
钟智强8 天前
CVE-2025-49844高危预警:Redis Lua脚本引擎UAF漏洞深度剖析与POC实战
数据库·redis·web安全·junit·lua
闲人编程8 天前
聚合管道与复杂查询
开发语言·oracle·lua·match·查询·聚合·lookup
会周易的程序员9 天前
cNetgate物联网网关内存数据表和数据视图模块架构
c语言·c++·物联网·架构·lua·iot
会周易的程序员10 天前
cNetgate插件架构设计详解 动态库 脚本二开lua, python, javascript
javascript·c++·python·物联网·lua·iot
猫头虎11 天前
web开发常见问题解决方案大全:502/503 Bad Gateway/Connection reset/504 timed out/400 Bad Request/401 Unauthorized
运维·前端·nginx·http·https·gateway·openresty
ZAEQgyKFs12 天前
基于RBF神经网络的车速预测模型及其在混动汽车能量管理中的应用研究
openresty
白太岁14 天前
Redis:(3) Lua 与 Redis、基于连接池的 Facade 模式封装
数据库·c++·redis·lua·外观模式
FJW02081415 天前
《Nginx 高级应用:变量、Rewrite、反向代理与 OpenResty 扩展》(3)
运维·nginx·openresty
Maguyusi18 天前
go 批量生成c++和lua proto文件
c++·golang·lua·protobuf
foxsen_xia19 天前
Kamailio通过Lua写路由
开发语言·lua·信息与通信