0

What is minimal HTTP 200 OK Connection close response for Nginx/lua/openresty. I have:

local sock, err = ngx.req.socket(true)
sock:send("HTTP/1.1 200 OK\\r\\nConnection: close\\r\\n\\r\\n")

and curl says:

curl: (52) Empty reply from server
Sergii Getman
  • 3,845
  • 5
  • 34
  • 50

1 Answers1

1

In a case of no response body, you should probably use 204 No Content response code; "201 Created" may be an option as well for requests that create resources.

Also: replace each double slash with a single one, as you don't need to escape slash to generate CR LF sequence.

Paul Kulchenko
  • 25,884
  • 3
  • 38
  • 56