从Nginx取得休息服务

时间:2018-08-29 23:57:43

标签: curl nginx lua

我有一个卷曲请求

 curl 'http://10.1.1.1/detail' -H 'Authorization: Basic lzY28=' -H 'Content-Type: application/x-www-form-urlencoded; charset=UTF-8' -H 'Accept: */*' -H 'Connection: keep-alive' --data $’test’

并且工作正常,现在当我尝试通过我的nginx lua访问它时,它不工作

我的nginx.conf

 location /detail {
                set $target '10.1.1.1/detail';
                set $pass 'Basic lzY28=';
                 lua_need_request_body on;
                proxy_set_header          Host            $host;
                proxy_set_header          X-Real-IP       $remote_addr;
                proxy_set_header          X-Forwarded-For $proxy_add_x_forwarded_for;
                proxy_set_header Authorization $pass;
                proxy_set_header Content-Type 'application/x-www-form-urlencoded';
                proxy_set_header Accept '*/*';
                proxy_set_header Connection 'keep-alive';
                proxy_pass http://$target;
        }

0 个答案:

没有答案