Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have a cluster of webservers running on apache-php (with prefork). I'm planning to move from prefork to worker (fcgi). The problem is that I cannot move all servers at once so for a short period of times (matter of days) few of them will be on fcgi and some on modphp. I tested today if the sessions are going to work between these two kind of servers (a test server with fcgi and a real with mod_php) and looks like not, I'm getting logged out when my proxy (basic nginx) is redirecting me from a ws with fcgi to one with mod_php. The application that is hosted on these servers is a magento with few modifications (nothing on the core). If I take the proxy out, everything works perfect, I can change from a node to another and the session is the same.

Is there anything in nginx that can cause this? Below is a part of the config of nginx:

 proxy_ignore_headers "Cache-Control" "Expires";

    proxy_cache_valid  200 302 60m;

    proxy_redirect     off;
    proxy_set_header   Host             $host;
    proxy_set_header   X-Real-IP        $remote_addr;
    proxy_set_header   X-Forwarded-For  $proxy_add_x_forwarded_for;
    proxy_max_temp_file_size 0;

    client_max_body_size       100m;
    client_body_buffer_size    128k;

    proxy_connect_timeout      600000;
    proxy_send_timeout         600000;
    proxy_read_timeout         600000;

    proxy_buffer_size          4k;
    proxy_buffers              4 32k;
    proxy_busy_buffers_size    64k;
    proxy_temp_file_write_size 64k;
    proxy_cache_use_stale  error timeout invalid_header updating http_500 http_502 http_503 http_504;
share|improve this question
up vote 1 down vote accepted

Not an answer, but maybe a clue.

FCGI does not have x_forwarded_for. You may be all set with:

proxy_set_header   X-Forwarded-For  $proxy_add_x_forwarded_for;

But it certainly can affect session/cookie management. We're working on a possible related issue:

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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