Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

【时好时坏】uidsuffix,新id第一次访问500,后面再刷新就正常 #102

Open
yongdi opened this issue Oct 29, 2018 · 1 comment

Comments

@yongdi
Copy link

yongdi commented Oct 29, 2018

2018/10/29 11:16:50 [error] 15232#0: *1462 [lua] utils.lua:32: dolog(): errcode : 200, errinfo : success redirect to upstream http://, client: 172...36, server: api-test.....com, request: "GET /1.0/phone/learn_more?uid=1003217&sig=77c2dd4c4eb5c8029ae795b6e473f89d%20HTTP/1.1 HTTP/1.1", host: "10....8"

比如这种,redirect to upstream http:// 啥也没有。
我用的是单层分流版本,就是uidsuffix,很简单的策略。

当用一个新uid的时候,错误必现,redirect为空,nginx返回500

配置如下:
————————————————
`upstream tiny-stable {
server 10....30:21110 max_fails=3 fail_timeout=30s;
server 10...31:21110 max_fails=3 fail_timeout=30s;
}
upstream beta {
server 10.....86:21110 max_fails=3 fail_timeout=30s;
}
...

location /xxx/ {
    proxy_set_header X-Forwarded-For $remote_addr;
    proxy_set_header Host $host;
    real_ip_header X-Real-IP;
#    proxy_set_header Connection "";
#    proxy_http_version 1.1;


    rewrite /xxx/(.+)$ /$1 break;

    set $backend $default_backend;
    rewrite_by_lua_file '../diversion/diversion.lua';

    proxy_pass http://$backend;
}

`

@yongdi yongdi changed the title 【时好时坏】分流有时候redirect to null空 【时好时坏】第一次访问500,后面再刷新就正常 Oct 30, 2018
@yongdi yongdi changed the title 【时好时坏】第一次访问500,后面再刷新就正常 【时好时坏】uidsuffix,新id第一次访问500,后面再刷新就正常 Oct 30, 2018
@Toifyx
Copy link

Toifyx commented Sep 27, 2019

你好,你的backend 应该是没有设置默认值。导致upstream是空

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants