winson030

winson030

V2EX 第 589353 号会员,加入于 2022-07-28 20:10:40 +08:00
今日活跃度排名 23500
大龄油新码农预备军,努力学习Java 和 Vue.js 中。
winson030 最近回复了
117 天前
回复了 DIO 创建的主题 程序员 有办法高速浏览 tor 吗
提供一个思路:
1. 准备一台可以提供透明代理的 安卓手机 /软路由 as 出口设备
2. 准备一个线路好一点的出口在美国的节点,v2ray ,xray 的都行
3. 在出口设备配好美国节点的透明代理,下载机通过 WiFi 、数据线、网线连接出口设备,一般是 DHCP 接入
4. 下载机上的 tor relay 节点地区定死在美国,有个配置文件可以改的
5. 确保代理出口在美国,tor relay 也在美国,这样理论上就稳了。
117 天前
回复了 xiaoyuesanshui 创建的主题 Linux NGINX 间歇 502 , conncetion refused
可以看看我发过的一个帖子,也是遇到 502 的情况。我这边主要是因为订阅转换链接太长了,nginx 没设置反向代理缓冲区,导致返回 502 。把 proxy_buffer_size 相关的设置都配一下,应该就可以了。试试看。
@eason1874 长链接在配置完代理缓冲区后成功加载了!感谢!
@winson030

查到问题根源了,是 nginx 反向代理的代理缓冲问题,subweb 的长链接太长了导致 nginx 报 502 ,解决方案是将反向代理缓存的相关内容设置得大一些。
```nginx
fastcgi_buffers 16 16k;
fastcgi_buffer_size 32k;
proxy_buffer_size 128k;
proxy_buffers 4 256k;
proxy_busy_buffers_size 256k;
```
@eason1874

```shell
2022/11/30 18:40:59 [error] 237#237: *353 upstream sent too big header while reading response header from upstream, client: a.b.c.d, server: a.b.c.d, request: "GET /W8yuvkA HTTP/2.0", upstream: "http://a.b.c.d:8002/W8yuvkA", host: "a.b.c.d"
2022/11/30 18:41:24 [error] 237#237: *353 upstream sent too big header while reading response header from upstream, client: a.b.c.d, server: a.b.c.d, request: "GET /W8yuvkA HTTP/2.0", upstream: "http://a.b.c.d:8002/W8yuvkA", host: "a.b.c.d"
2022/11/30 18:41:55 [error] 237#237: *353 upstream sent too big header while reading response header from upstream, client: a.b.c.d, server: a.b.c.d, request: "GET /W8yuvkA HTTP/2.0", upstream: "http://a.b.c.d:8002/W8yuvkA", host: "a.b.c.d"

```

看到 nginx 的报错说 " upstream sent too big header while reading response header from upstream",感觉是长链接的字节流太大了?这种情况不知道要咋整?
@eason1874 试了下,返回了下面这些信息

```shell
HTTP/2 502
server: nginx/1.23.2
date: Wed, 30 Nov 2022 18:23:35 GMT
content-type: text/html
content-length: 157

<html>
<head><title>502 Bad Gateway</title></head>
<body>
<center><h1>502 Bad Gateway</h1></center>
<hr><center>nginx/1.23.2</center>
</body>
</html>
```
这里能看出什么问题吗?
@eason1874

如果不是 cloudflare 的配置问题,那就麻烦了,又要重新排查。
@eason1874

```shell
[email protected] ~/myurls# docker logs myurls
[GIN] 2022/11/30 - 17:15:27 | 200 | 704.002µs | a.b.c.d | GET "/"
2022/11/30 17:15:38 Hit cache: gpx3R8g
[GIN] 2022/11/30 - 17:15:38 | 200 | 1.762924ms | a.b.c.d | POST "/short"
[GIN] 2022/11/30 - 17:15:43 | 301 | 988.202µs | a.b.c.d | GET "/gpx3R8g"
[GIN] 2022/11/30 - 17:18:34 | 301 | 5.359253ms | a.b.c.d | GET "/gpx3R8g"
[GIN] 2022/11/30 - 17:22:29 | 301 | 1.425363ms | a.b.c.d | GET "/gpx3R8g"
```
docker 上的日志是这样的,没看出啥毛病呀?
投了快四个月,面试也就零星几个,想不躺平都难
花些时间整理过去的碎片也是个不错的选择,比如断舍离、整理技术文档、整理日志之类的。
关于   ·   帮助文档   ·   博客   ·   nftychat   ·   API   ·   FAQ   ·   我们的愿景   ·   广告投放   ·   实用小工具   ·   3619 人在线   最高记录 5556   ·     Select Language
创意工作者们的社区
World is powered by solitude
VERSION: 3.9.8.5 · 39ms · UTC 10:17 · PVG 18:17 · LAX 03:17 · JFK 06:17
Developed with CodeLauncher
♥ Do have faith in what you're doing.