Closed wenyifancc closed 8 months ago
可以正常访问google, youtube之类的网站么? 还是特定网站有这个问题?
所有网站都有这个问题,google也是如此,根据nginx日志,可能是nginx验证了上游返回的http响应头中同时出现了Content-Length和Transfer-Encoding
nginx发现siteproxy返回的response中同时存在了Content-Length和Transfer-Encoding的header,然后就拒绝转发了,目前可用的变通方法是通过caddy中转下,兼容这种特殊header的情况
services:
site-proxy:
image: node:18
container_name: site-proxy
restart: unless-stopped
volumes:
- ./siteproxy/:/home/node/siteproxy/
working_dir: /home/node/siteproxy/
entrypoint: ["node","/home/node/siteproxy/bundle.js"]
caddy:
image: caddy:latest
container_name: caddy
restart: unless-stopped
ports:
- 127.0.0.1:5007:5007
entrypoint: ["caddy","reverse-proxy","-f",":5007","-t","http://site-proxy:5006"]
v2.1.15已经解决。
Nginx Error Log: upstream sent "Content-Length" and "Transfer-Encoding" headers at the same time while reading response header from upstream
Nginx Version: nginx/1.23.1
使用docker-compose部署模式