update conf

This commit is contained in:
2022-02-03 20:35:56 +08:00
parent 6450de903c
commit 155bd693b2
2 changed files with 34 additions and 1 deletions
+33
View File
@@ -1,3 +1,36 @@
使用自动化脚本进行配置文件和`lua`代码的更新。
以macos本地环境为例,使用`cp_scripts_local_macos.sh`:
```bash
➤ ./cp_scripts_local_macos.sh 20:31:54
+ mkdir -p /usr/local/etc/openresty/conf.d
+ cp conf/local_macos/admin.conf conf/local_macos/music-room.conf conf/local_macos/ts.conf /usr/local/etc/openresty/conf.d/
+ cp scripts/combine.lua scripts/convert_audio.lua scripts/strip_path.lua scripts/test_upyun_token.lua scripts/test_upyun_upload.lua scripts/upload.lua scripts/upload_audio.lua scripts/upyun.lua scripts/upyun_token.lua /usr/local/opt/openresty/resty_funcs/
```
第一次更新记得在`nginx.conf`里面include配置目录`conf.d`:
```bash
➤ tail -n 5 /usr/local/etc/openresty/nginx.conf
#}
include /usr/local/etc/openresty/conf.d/*.conf;
}
```
检查配置没有问题:
```bash
➤ openresty -t
nginx: the configuration file /usr/local/etc/openresty/nginx.conf syntax is ok
nginx: [warn] 1024 worker_connections exceed open file resource limit: 256
nginx: configuration file /usr/local/etc/openresty/nginx.conf test is successful
```
---
resty里请求域名地址时无法使用本地的`/etc/hosts`文件,需在`nginx.conf`文件中的`http`模块内添加`resolver`配置显式指定: resty里请求域名地址时无法使用本地的`/etc/hosts`文件,需在`nginx.conf`文件中的`http`模块内添加`resolver`配置显式指定:
```nginx ```nginx
+1 -1
View File
@@ -2,7 +2,7 @@
set -x set -x
mkdir -p /usr/local/etc/openresty/conf.d mkdir -p /usr/local/etc/openresty/conf.d
cp local_macos/*.conf /usr/local/etc/openresty/conf.d/ cp conf/local_macos/*.conf /usr/local/etc/openresty/conf.d/
cp scripts/*.lua /usr/local/opt/openresty/resty_funcs/ cp scripts/*.lua /usr/local/opt/openresty/resty_funcs/