smallparking 最近的时间轴更新
smallparking
ONLINE

smallparking

V2EX 第 545416 号会员,加入于 2021-05-15 13:53:00 +08:00
今日活跃度排名 6279
smallparking 最近回复了
啥意思?要轻很简单啊 装 mininal 就行了
2 天前
回复了 guoguobaba 创建的主题 Node.js 问个页面跳转访问方案
不是有免费域名 eu.org 吗? 我用的这个
@nlzy 你这样一说确实是不可调和的矛盾了,还是让 rust 自己开分支维护吧,让用户决定 C kernel 和 RUST 哪个更好
49 天前
回复了 exqibao 创建的主题 NGINX nginx 配置根据请求头分发问题
使用 map ,测试了一下没问题
```
# 根据请求头 environment_name 映射目标地址
map $http_environment_name $backend {
default http://127.0.0.1:8022/api/; # 默认地址
loc http://127.0.0.1:28080; # loc 的地址
pro http://127.0.0.1:8011/api/; # pro 的地址
}

server {
listen 80;

location /aa {
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $remote_addr;

# 动态选择后端
proxy_pass $backend;
}
}
```

```
~ » cat test_njet.sh 130 ↵ xtcc@xtcc-b560m-power
curl -H "environment-name: " http://127.0.0.1:8089/aa
curl -H "environment-name: ssss" http://127.0.0.1:8089/aa
curl -H "environment-name: loc" http://127.0.0.1:8089/aa
curl -H "environment-name: pro" http://127.0.0.1:8089/aa
```
```
2025/01/13 17:02:01 [error] 238783#0: *1 connect() failed (111: Connection refused) while connecting to upstream, client: 127.0.0.1, server: , request: "GET /aa HTTP/1.1", upstream: "http://127.0.0.1:8022/api/", host: "127.0.0.1:8089"
2025/01/13 17:02:01 [error] 238784#0: *3 connect() failed (111: Connection refused) while connecting to upstream, client: 127.0.0.1, server: , request: "GET /aa HTTP/1.1", upstream: "http://127.0.0.1:8022/api/", host: "127.0.0.1:8089"
2025/01/13 17:02:01 [error] 238785#0: *5 connect() failed (111: Connection refused) while connecting to upstream, client: 127.0.0.1, server: , request: "GET /aa HTTP/1.1", upstream: "http://127.0.0.1:28080/aa", host: "127.0.0.1:8089"
2025/01/13 17:02:01 [error] 238786#0: *7 connect() failed (111: Connection refused) while connecting to upstream, client: 127.0.0.1, server: , request: "GET /aa HTTP/1.1", upstream: "http://127.0.0.1:8011/api/", host: "127.0.0.1:8089"

```

顺便推广一下我们的 njet: https://gitee.com/njet-rd/njet
@xiaoyuan9816 https://www.cac.gov.cn/2024-04/02/c_1713729983803145.htm
有备案吗? 还用国外 api ?符合 "坚持社会主义核心价值观" 吗?
https://www.cac.gov.cn/2023-07/13/c_1690898327029107.htm
77 天前
回复了 javazero 创建的主题 NAS truenas 的系统盘坏了。。。
别用 dd 了 麻烦,我推荐使用 Clonezilla 。之前我迁移也是用的这个,有多余硬盘还可以先备份系统
77 天前
回复了 andyfan 创建的主题 NGINX 请教下 nginx 反代配置
@smallparking 看一下 404 的请求的 error_log 就知道 404 的原因了
关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   实用小工具   ·   4134 人在线   最高记录 6679   ·     Select Language
创意工作者们的社区
World is powered by solitude
VERSION: 3.9.8.5 · 11ms · UTC 00:59 · PVG 08:59 · LAX 16:59 · JFK 19:59
Developed with CodeLauncher
♥ Do have faith in what you're doing.