随笔分类 - Nginx/OpenResty/Lua
摘要:1、应用场景: 当存在多个域名时,如果所有配置都写在 nginx.conf 主配置文件中,难免会显得杂乱与臃肿。 为了方便配置文件的维护,所以需要进行拆分配置。 2、在 nginx 的 conf 目录下 创建 vhost 文件夹: [root@Centos conf]# pwd /usr/local
阅读全文
摘要:1、alias 配置: location /resources/image/ { alias /local_path/image/; }# 访问:http://127.0.0.1/resources/image/test.png# 定位资源路径为:/local_path/image/test.png
阅读全文
摘要:server { listen 80; server_name localhost; location /api1/ { proxy_pass http://localhost:8080; } # http://localhost/api1/xxx -> http://localhost:8080/
阅读全文
摘要:1、内置变量: 变量名称 变量用途 $args 这个变量等于GET请求中的所有参数,所以是复数带有s。例如,foo=123&bar=blahblah;这个变量只可以被修改 $arg_param 获取GET请求中param参数的值。如/index.html?order=111, 则$arg_order
阅读全文
摘要:1、在官网下载 Lua: 2、解压下载的文件: 解压的目录,可根据自己实际情况修改。 3、在 Idea 安装 EmmyLua 插件: 安装完成后,需要重启Idea。 4、配置运行调试环境: (1)创建 Lua project: 2、新建 test.lua 文件: (3)指定 Lua 解释器所在路径和
阅读全文
摘要:1、安装 openresty 依赖模块: [root@Centos opt]# yum -y install pcre-devel openssl openssl-devel postgresql-devel 2、编译安装 openresty: [root@Centos opt]# tar -zxv
阅读全文

浙公网安备 33010602011771号