This in each of my virtual host configuration. This is very redundant.
For example if I want to use tcp socket for fastcgi_pass, I need to edit
every single vhost configuration.
What are you advices to avoid this ? What is the recommended practice ?
Someone adviced my to use include… Could you show me an example ?
Yup, include is the way I would do that personally.
Documentation: Core functionality
The funny thing is you already are using the ‘include’ directive: look
at
your ‘include fastcgi_params;’ line. There must be a ‘fastcgi_params’
file
in your configuration directory…
That probably comes from the part you copied/pasted from the sample doc.
The way to go would be to put the redundant configuration part in it
then
call it wherever necessary in the vhosts conf.
The docs tell you that include can be used in any context you wish, you
just need to decide on the granularity.
I did read the page Core functionality but I sometimes
get confused how to put things in order exactly.
I removed the root stanza in the location block.
As for fastcgi_params I already have the line
fastcgi_param SCRIPT_NAME $fastcgi_script_name;
which looks like the one you wrote
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
in your my_fastcgi_params
What is the difference between those two ? I didn’t see SCRIPT_NAME in
the HttpFastcgiModule documentation whereas SCRIPT_FILENAME is defined
by “Parameter SCRIPT_FILENAME is used by PHP for determining the name of
script to execute”
Also, where should I put my include files ? It seems that /etc/nginx is
the default location. Or you put them in another directory ?
Cheers
This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.