还可以直接使用openresty的内置lua模块
openresty是什么
openresty也是web服务器,是基于nginx开发出来,但其内置了lua扩展功能,能让你编写lua脚本对其进行扩展。
安装openresty
我们下面只说centos下的安装方法,其它平台安装方法请参照官网文档:
https://openresty.org/en/installation.html添加软件仓库源
wget https://openresty.org/package/centos/openresty.repo -O /etc/yum.repos.d/openresty.repo
安装软件
yum install openresty
3、打开配置文件
vim /usr/local/openresty/nginx/conf/nginx.conf
4、修改配置文件内容如下
worker_processes 1; events { worker_connections 1024; } http { include mime.types; default_type application/octet-stream; sendfile on; keepalive_timeout 65; server { listen 80; server_name localhost; location / { default_type text/html; content_by_lua_block { ngx.say("<h1>Hello Openresty</h1>") } } } }5、启动openrestysystemctl restart openresty
6、访问http://127.0.0.1显示如下信息
Hello Openresty
7、限流原理是一样的,可以直接写lua脚本。
网友回复
ai先写功能代码通过chrome mcp来进行测试功能最后ai美化页面这个流程能行吗?
vue在手机端上下拖拽元素的时候如何禁止父元素及body的滚动导致无法拖拽完成?
使用tailwindcss如何去掉响应式自适应?
有没有直接在浏览器中运行的离线linux系统?
nginx如何保留post或get数据进行url重定向?
python有没有能绕过Cloudflare人机验证的爬虫库?
有没有免费的股票量化交易本地部署预测模型?
如何根据一张人脸照片全网人肉搜索这个人的其他照片或信息?
js版本iife esm umd cjs有啥区别?
如何将ctrl+c复制的网页图文列表自动解析成可编辑的电子表格?