Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

Is best to put the fastcgi_pass 127.0.0.1:9000 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
add comment

1 Answer

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
add comment

Your Answer

 
discard

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.