LMLPHP后院

记录一个 nginx 异常退出技术

maybe yes 发表于 2026-05-20 12:11

Record it

● nginx.service - A high performance web server and a reverse proxy server
     Loaded: loaded (/lib/systemd/system/nginx.service; enabled; vendor preset: enabled)
     Active: failed (Result: exit-code) since Wed 2026-05-20 03:44:49 UTC; 22s ago
       Docs: man:nginx(8)
    Process: 2120130 ExecStartPre=/usr/sbin/nginx -t -q -g daemon on; master_process on; (code=exited, status=1/FAILURE)
        CPU: 28ms

May 20 03:44:48 debian-s-1vcpu-1gb-nyc1-01-d114 systemd[1]: Starting A high performance web server and a reverse proxy server...
May 20 03:44:49 debian-s-1vcpu-1gb-nyc1-01-d114 nginx[2120130]: nginx: [emerg] too long parameter "183.141.20..." started in /etc/nginx/sites-enabled/upstream.conf:4
May 20 03:44:49 debian-s-1vcpu-1gb-nyc1-01-d114 nginx[2120130]: nginx: configuration file /etc/nginx/nginx.conf test failed
May 20 03:44:49 debian-s-1vcpu-1gb-nyc1-01-d114 systemd[1]: nginx.service: Control process exited, code=exited, status=1/FAILURE
May 20 03:44:49 debian-s-1vcpu-1gb-nyc1-01-d114 systemd[1]: nginx.service: Failed with result 'exit-code'.
May 20 03:44:49 debian-s-1vcpu-1gb-nyc1-01-d114 systemd[1]: Failed to start A high performance web server and a reverse proxy server.

Because upstream param is too long ...

缘起 CF 响应的 http x forwarded for 包含了重复的 ip,类似于 1.1.1.1,1.1.1.1 这样子,这个应该是 CF 的 bug。几年难得一见。这一点上机器永远无法超越人类,因为机器不会思考,人的视觉对于一个错误是会发现的,机器之所以快,就是因为绝大多数数据不会加以判断,是不可能做到,比如说一些基本常识发生变化的时候,人能感觉不对劲,但是人写的代码,或者是调教出来的机器,对于常识是不会检查的。比如人是两个眼睛,突然一天,出现了很多三只眼睛的人,我们作为人会立即发现这个错误,但是机器不会,机器对于某些场景是不可能是怀疑常识的。换而言之,就是人的判断次数,远远超越机器,机器只会在需要判断的时候加以判断,一旦通关之后,不会再次加以判断。

2026-05-20 14:07:19 1779257239 0.011710