nginx代理返回11:资源暂时不可用

时间:2017-08-22 11:46:48

标签: nginx

这是我从错误日志中获得的调试级别信息

"GET /api/account/logout HTTP/1.0
Host: http://SERVER_IP/
Connection: close
Cache-Control: max-age=0
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/60.0.3112.90 Safari/537.36
Upgrade-Insecure-Requests: 1
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8
Accept-Encoding: gzip, deflate
Accept-Language: zh-CN,zh;q=0.8,en-US;q=0.6,en;q=0.4,zh-TW;q=0.2

"
2017/08/22 19:38:42 [debug] 22939#0: *62 http cleanup add: 00007F557D385FD0
2017/08/22 19:38:42 [debug] 22939#0: *62 get rr peer, try: 1
2017/08/22 19:38:42 [debug] 22939#0: *62 stream socket 8
2017/08/22 19:38:42 [debug] 22939#0: *62 epoll add connection: fd:8 ev:80002005
2017/08/22 19:38:42 [debug] 22939#0: *62 connect to 10.14.6.4:80, fd:8 #63
2017/08/22 19:38:42 [debug] 22939#0: *62 http upstream connect: -2
2017/08/22 19:38:42 [debug] 22939#0: *62 posix_memalign: 00007F557D2E7DE0:128 @16
2017/08/22 19:38:42 [debug] 22939#0: *62 event timer add: 8: 60000:1503401982521
2017/08/22 19:38:42 [debug] 22939#0: *62 http finalize request: -4, "/admin_api/account/logout?" a:1, c:2
2017/08/22 19:38:42 [debug] 22939#0: *62 http request count:2 blk:0
2017/08/22 19:38:42 [debug] 22939#0: *62 post event 00007F557D41A6E0
2017/08/22 19:38:42 [debug] 22939#0: *62 delete posted event 00007F557D41A6E0
2017/08/22 19:38:42 [debug] 22939#0: *62 http run request: "/admin_api/account/logout?"
2017/08/22 19:38:42 [debug] 22939#0: *62 http upstream check client, write event:1, "/admin_api/account/logout"
2017/08/22 19:38:42 [debug] 22939#0: *62 http upstream recv(): -1 (11: Resource temporarily unavailable)
2017/08/22 19:38:42 [debug] 22939#0: *62 post event 00007F557D41A740
2017/08/22 19:38:42 [debug] 22939#0: *62 delete posted event 00007F557D41A740
2017/08/22 19:38:42 [debug] 22939#0: *62 http upstream request: "/admin_api/account/logout?"
2017/08/22 19:38:42 [debug] 22939#0: *62 http upstream send request handler
2017/08/22 19:38:42 [debug] 22939#0: *62 http upstream send request
2017/08/22 19:38:42 [debug] 22939#0: *62 http upstream send request body
2017/08/22 19:38:42 [debug] 22939#0: *62 chain writer buf fl:1 s:467
2017/08/22 19:38:42 [debug] 22939#0: *62 chain writer in: 00007F557D386008
2017/08/22 19:38:42 [debug] 22939#0: *62 writev: 467 of 467
2017/08/22 19:38:42 [debug] 22939#0: *62 chain writer out: 0000000000000000
2017/08/22 19:38:42 [debug] 22939#0: *62 event timer del: 8: 1503401982521
2017/08/22 19:38:42 [debug] 22939#0: *62 event timer add: 8: 60000:1503401982522
2017/08/22 19:38:42 [debug] 22939#0: *62 post event 00007F557D402730
2017/08/22 19:38:42 [debug] 22939#0: *62 post event 00007F557D41A740
2017/08/22 19:38:42 [debug] 22939#0: *62 delete posted event 00007F557D402730
2017/08/22 19:38:42 [debug] 22939#0: *62 http upstream request: "/admin_api/account/logout?"
2017/08/22 19:38:42 [debug] 22939#0: *62 http upstream process header
2017/08/22 19:38:42 [debug] 22939#0: *62 malloc: 00007F557D35A4D0:4096
2017/08/22 19:38:42 [debug] 22939#0: *62 recv: fd:8 325 of 4096
2017/08/22 19:38:42 [debug] 22939#0: *62 http proxy status 400 "400 Bad Request"
2017/08/22 19:38:42 [debug] 22939#0: *62 http proxy header: "Server: nginx/1.10.2"
2017/08/22 19:38:42 [debug] 22939#0: *62 http proxy header: "Date: Tue, 22 Aug 2017 11:38:42 GMT"
2017/08/22 19:38:42 [debug] 22939#0: *62 http proxy header: "Content-Type: text/html"
2017/08/22 19:38:42 [debug] 22939#0: *62 http proxy header: "Content-Length: 173"
2017/08/22 19:38:42 [debug] 22939#0: *62 http proxy header: "Connection: close"
2017/08/22 19:38:42 [debug] 22939#0: *62 http proxy header done
2017/08/22 19:38:42 [debug] 22939#0: *62 xslt filter header
2017/08/22 19:38:42 [debug] 22939#0: *62 HTTP/1.1 400 Bad Request

我正在将请求转发给内部服务器。我得到的请求有admin_api前缀,应该转发到带有api前缀的内部服务器。这是我的Nginx配置。

server {
    listen 8006;
    server_name THIS_SERVER_IP; 
    root /usr/share/nginx;
    error_log /var/log/nginx/xxx-error.log debug;

    location /admin_api {
      proxy_pass http://INTERNAL_SERVER_IP/api;
      proxy_set_header Host http://INTERNAL_SERVER_IP/;
      proxy_pass_request_headers On;
    }

    location / {
        try_files $uri /index.html;
    }
}

0 个答案:

没有答案