nginx错误:重定向到命名位置“ @s”时,重写或内部重定向周期

时间:2018-06-27 02:58:08

标签: nginx

这是我的Nginx配置文件:

http {
    server {
            listen 8080;
            location / {
                    root /data;
            }

    }
    server {
            listen  8081;
            location / {
                    root /data;
            }

    }
    upstream sample {
            server 127.0.0.1:8081;
    }
    upstream sample1{
            server 127.0.0.1:8080;
    }
    server {
            listen 80;
            access_by_lua_block {
                    if(type(ngx.var.arg_variable)~="nil") then
                            key=tonumber(ngx.var.arg_variable) % 2
                                    if (key==0) then
                                            ngx.exec("@s")
                                    else
                                            ngx.exec("@s1")
                                                    end
                    else
                            ngx.say("none variable variable=")
                                    end

            }
            location @s{
            proxy_pass http://sample;
            }
            location @s1{
                    proxy_pass http://sample1;
            }
    }...

我得到一个错误:重写或内部重定向周期,同时访问链接http://localhost/t/temp.html?variable=70时重定向到命名位置“ @s” ; 请提供帮助。

0 个答案:

没有答案
相关问题