nginx 返回长度错误的网络字符串?

nginx 返回长度错误的网络字符串?

nginx version: nginx/1.7.9我通过 macports 在运行最新 OSX 的 mac 上安装了 nginx ( )。

我配置了一个 URI 以使用 SCGI:

location /server {
    include /Users/ruipacheco/Projects/Assorted/nginx/conf/scgi_params;
    scgi_pass unix:/var/tmp/rpc.sock;
    #scgi_pass 127.0.0.1:9000;
}

当我执行 GET 操作时,127.0.0.1/server我可以在 SCGI 服务器上看到以下内容:

633:CONTENT_LENGTH0REQUEST_METHODGETREQUEST_URI/serverQUERY_STRINGCONTENT_TYPEDOCUMENT_URI/serverDOCUMENT_ROOT/opt/local/htmlSCGI1SERVER_PROTOCOLHTTP/1.1REMOTE_ADDR127.0.0.1REMOTE_PORT62088SERVER_PORT80SERVER_NAMElocalhostHTTP_HOST127.0.0.1HTTP_CONNECTIONkeep-aliveHTTP_CACHE_CONTROLmax-age=0HTTP_ACCEPTtext/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8HTTP_USER_AGENTMozilla/5.0 (Macintosh; Intel Mac OS X 10_10_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/40.0.2214.115 Safari/537.36HTTP_DNT1HTTP_ACCEPT_ENCODINGgzip, deflate, sdchHTTP_ACCEPT_LANGUAGEen-US,en;q=0.8,End of file

问题在于网络字符串 (633) 的长度与解释不匹配。如果我理解网络字符串规格:正确地,633 应该是第一个和最后一个之间的字符长度,

Any string of 8-bit bytes may be encoded as [len]":"[string]",". Here [string] is the string and [len] is a nonempty sequence of ASCII digits giving the length of [string] in decimal. The ASCII digits are <30> for 0, <31> for 1, and so on up through <39> for 9. Extra zeros at the front of [len] are prohibited: [len] begins with <30> exactly when [string] is empty.

For example, the string "hello world!" is encoded as <31 32 3a 68 65 6c 6c 6f 20 77 6f 72 6c 64 21 2c>, i.e., "12:hello world!,".

所以,我得到了错误的长度。这该如何解释呢?

相关内容