1

Is there a difference between what headers php returns and what is set in nginx?

When I run:

curl -I mydomain.com

I get as expected (I have keep-alive off)

Connection: close

But when I output the $_SERVER[HTTP_CONNECTION] on that same domain I get:

Connection: keep-alive

I am not sure why php is returning keep-alive where everywhere else I pull the headers and it shows connection closed.

0

$_SERVER[HTTP_CONNECTION] in PHP contains Connection header from client's request, telling the server that client supports keep-alive.

What you see with cURL's output, is the response from server, telling that connection will be closed instead of kept open for keep-alive.

  • 1
    I thought I read that somewhere but the problem is I go to another site hosted that is hosted via GoDaddy and in the same browser and it shows Connection: close as the PHP variable. – jrodichok Dec 22 '15 at 19:13

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.