Hi,
I’ve been searching (last two days) to find how to setup multiple php
sites
using nginx. Couldn’t find any documentation around it, hence writing it
here.
I’ve two codeignetor (php framework) in two different folders and served
from same domain. For an example,
I made the first one to work using the following code. Can someone help
me
to modify this config to fit the second requirement?!
(the configurations I tried doesn’t pass the query strings - hence
pasting
the working version)
in the php location . Move up the root in location / to the server {}
level and delete the root from php location . This is also the best
approach as per nginX docs
— Original message —
From: “B.R.” [email protected]
Date: 15 July 2014, 19:16:19
I also think CodeIgniter needs the PATH_INFO environment variable set.
This is not true, as you can choose of using PATH_INFO, QUERY_STRING,
REQUEST_URI and so on, so this tricks with path_info is excessive.
Just use try_files and fastcgi_split_path_info
include fastcgi_params;
On Tue, Jul 15, 2014 at 4:31 PM, Anoop A. wrote:
Perhaps this didnt work for you because you have
root /var/www/example/;
in the php location . Move up the root in location / to the server {}
level and delete the root from php location . This is also the best
approach as per nginX docs
If you use try_files with fastcgi_split_path_info, do not try to set
PATH_INFO with $fastcgi_path_info directly as it will be empty.
If PATH_INFO is not set (as it might not be required like you point it
out)
and stick with the $fastcgi_script_name of the split directive, then the
PATH_INFO 2-lines trick is indeed useless but the rest is correct and
recommended.