We help IT Professionals succeed at work.
Get Started

Nginx return empty data, while header is 200 OK

longvan
longvan asked
on
3,595 Views
Last Modified: 2014-05-23
I have a problem with my rest service as below:

 1. a server with NGinx, PHP-FPM, provide rest service: example: http://example.com/rest.php, this link only show content: 1001:Successfully
 2. another server using curl call this rest service to get content. With happy case, it must get content from rest service is 1001:Successfully. But problem happen -
In most case it get content ok, but sometimes I get empty content while http_status is 200 ok. I don't know what is happening. Could anyone help me?

Empty content and CURL debug information as below:

    '* About to connect() to example.com port 80 (#0)
    *   Trying xxx.xxx.xxx.xxx...
    * connected
    * Connected to example.com (xxx.xxx.xxx.xxx) port 80 (#0)
    > GET /rest.php HTTP/1.1
    User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; rv:1.7.3) Gecko/20041001 Firefox/0.10.1
    Host: example.com
    Accept: */*
    Accept-Encoding: deflate, gzip
   
    < HTTP/1.1 200 OK
    < Server: XXX
    < Date: Mon, 12 May 2014 12:58:17 GMT
    < Content-Type: text/html
    < Transfer-Encoding: chunked
    < Connection: keep-alive
    < 
    * Connection #0 to host channel.ssgroup.vn left intact
    * Closing connection #0
    ',
    )
Comment
Watch Question
Commented:
This problem has been solved!
Unlock 3 Answers and 8 Comments.
See Answers
Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant
Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

  • Troubleshooting
  • Research
  • Professional Opinions
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE