I'm in the process of moving a working apache/mod-php website to nginx/php-fpm.
Under Apache/mod-php, I could use header("Location: $url");
to redirect the browser to a different page, such as after a login attempt. After switching to nginx/php-fpm, the browser would no longer follow that redirect on certain pages. I confirmed with Firebug and Httpfox that the header "Location: [url]" was actually being received in the response. This behavior also appears in Chrome (not tested in IE).
So I did a few experiments, read a few things about http, and made it work, but I'm not sure why it works (or why it didn't).
The solution I came up with was to send a "Status: 303" header before the "Location: [url]" header. This works in Chrome and Firefox, which both ignored the Location header when I sent "Status: 200" or omitted the Status header, but did the redirect when I changed it to "Status 303". It worked with Status 200 under Apache.
Is the Status header required to use the Location header? Or was Apache doing something else to make it work? I've not changed any of the php code involved other than the header("Status: 303");
line that made it work. There has to be something else at work here, but I have no clue what it could be.
Any ideas?