Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

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

Is best to put the fastcgi_pass directive in the fastcgi_params file for NGiNX, or to explicitly state it in the location for \.php$?

Or does it not really matter?

share|improve this question
up vote 3 down vote accepted

You want to put it directly in the location block, because the fastcgi_params file is intended to be shared by multiple blocks which can pass to a different FastCGI server. The fastcgi_params also gets rid of the "noise" of all the paramater definitions which are not important most of the time, but the fastcgi_pass directive is always important when dealing with configurations. Lastly, the name fastcgi_params implies that it only contains fastcgi_param directives -- using it for other directives will confuse others (and probably you in a couple months) trying to understand the configuration.

share|improve this answer
Good points. I was curious, because I felt the same way about the confusion part. In their full example they have a fastcgi_index directive listed in their fastcgi_conf file, which I found rather odd. However, it is named fastcgi_conf, rather than fastcgi_params, which makes slightly more sense. – nojak Aug 27 '12 at 23:47

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.