



















RT
1.主服务器需要反代到mini,但mini为动态IP,之前已经写了动态更新dns,但是时间太大了,修改为60s再测试一下;
location /compare_similarity {
# 其他配置
resolver 114.114.114.114 8.8.8.8 valid=60s;
}2.mini上的nginx总是出现端口复用绑定失败的提醒,排查了一下似乎是因为macos的启动项设置造成的,关闭了开机启动nginx的plist配置,直接通过手动启动,问题解决。
报错信息如下:
2026/04/25 09:36:13 [warn] 17279#0: the "user" directive makes sense only if the master process runs with super-user privileges, ignored in /opt/homebrew/Cellar/nginx/conf/nginx.conf:2 2026/04/25 09:36:13 [emerg] 17279#0: bind() to 0.0.0.0:8446 failed (48: Address already in use)2026/04/25 09:36:13 [emerg] 17279#0: bind() to 0.0.0.0:8444 failed (48: Address already in use)2026/04/25 09:36:13 [emerg] 17279#0: bind() to 0.0.0.0:8446 failed (48: Address already in use)2026/04/25 09:36:13 [emerg] 17279#0: bind() to 0.0.0.0:8444 failed (48: Address already in use)2026/04/25 09:36:13 [emerg] 17279#0: bind() to 0.0.0.0:8446 failed (48: Address already in use)2026/04/25 09:36:13 [emerg] 17279#0: bind() to 0.0.0.0:8444 failed (48: Address already in use)2026/04/25 09:36:13 [emerg] 17279#0: bind() to 0.0.0.0:8446 failed (48: Address already in use)2026/04/25 09:36:13 [emerg] 17279#0: bind() to 0.0.0.0:8444 failed (48: Address already in use)2026/04/25 09:36:13 [emerg] 17279#0: bind() to 0.0.0.0:8446 failed (48: Address already in use) 2026/04/25 09:36:13 [emerg] 17279#0: bind() to 0.0.0.0:8444 failed (48: Address already in use)2026/04/25 09:36:13 [emerg] 17279#0: still could not bind()通过launchctl关掉nginx,改为下面的手动命令管理nginx,报错就消失了
sudo /opt/homebrew/Cellar/nginx/sbin/nginx3.mini上发现error.log已经有2G多了,用AI弄了一个手动切割脚本,再打开快多了.
新建clear.bash,增加执行权限,编辑内容
touch clear.sh
chmod u+x,g+x clear.sh
vi clear.sh脚本内容如下
!/bin/bash
LOG_PATH="/usr/local/nginx/logs" # 你的日志路径
#YESTERDAY=$(date -v-1d +%Y-%m-%d) # macOS 写法
YESTERDAY=$(date -d "yesterday" +%Y-%m-%d) # linux 写法
# 1. 移动并重命名文件
mv ${LOG_PATH}/access.log ${LOG_PATH}/access_${YESTERDAY}.log
mv ${LOG_PATH}/error.log ${LOG_PATH}/error_${YESTERDAY}.log
# 2. 向 Nginx 发送信号重新创建 access.log
# 这是 Nginx 的特性:收到 USR1 信号后会关闭当前日志并重新打开(不重启服务)
kill -USR1 $(ps aux | grep "nginx: master process" | grep -v grep | awk '{print $2}')4.blog新建文章总是链接跳转失败,后端报错如下,Gemini判断是localhost写法会导致ipv6问题,都建议改为127.0.0.1,问题解决
2026/04/25 10:51:43 [error] 30042#0: *856882 connect() failed (111: Connection refused) while con necting to upstream, client: xx.xx.xx.xx, server: blog.zhuyu.xyz, request: "GET /admin/manage-p osts.php?page=1 HTTP/1.1", upstream: "fastcgi://[::1]:9000", host: "blog.zhuyu.xyz", referrer: "h ttps://blog.zhuyu.xyz/admin/write-post.php?cid=458"
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。