I’ve set up nginx 1.0.10 with php5-fpm. I’ve tested the setup and I can
confirm that php works.
The problem is when I set up an alias under “location /” nginx can’t
load the php pages. Only static html files work.
On Sat, Dec 17, 2011 at 04:43:05AM -0500, tapir wrote:
Hello,
I’ve set up nginx 1.0.10 with php5-fpm. I’ve tested the setup and I can
confirm that php works.
The problem is when I set up an alias under “location /” nginx can’t
load the php pages. Only static html files work.
Any ideas?
Most likely, you’ve forgot to add corresponding alias in your .php
location.
I’ve added “fastcgi_param SCRIPT_FILENAME
$document_root/wordpress$fastcgi_script_name;”
and now it works.
As you might predict “$document_root/wordpress” is the alias for
“location /”.
So what’s the correct way of doing this? I mean I have other aliases as
well and I would like php to work with those also.
combining alias and fastcgi (php) is the fastest way to get headache.
Go with symlink instead.
I’ve added “fastcgi_param SCRIPT_FILENAME
$document_root/wordpress$fastcgi_script_name;”
and now it works.
As you might predict “$document_root/wordpress” is the alias for
“location /”.
So what’s the correct way of doing this? I mean I have other aliases as
well and I would like php to work with those also.
On Saturday 17 December 2011 18:58:59 tapir wrote:
I’ve added “fastcgi_param SCRIPT_FILENAME
$document_root/wordpress$fastcgi_script_name;”
and now it works.
As you might predict “$document_root/wordpress” is the alias for
“location /”.
So what’s the correct way of doing this? I mean I have other aliases as
well and I would like php to work with those also.
ok I thought it didn’t. what I’m trying to do is to install the
wordpress on it’s own directory under the document root but I want it to
be accessible directly from mydomain.com. Wordpress allows you to do it
actually but I need a web server level solution because if I change it
in wordpress, it messes up some links (thousands) generated by poorly
designed plugins.
but somehow I have to define all the fastcgi params everytime. for
example can’t I just define fatscgi_pass and fastcgi_index once instead
of everytime for a new location.
one last question: how can I get rid off the same fastcgi lines. can’t I
just define those globally? do I have to type the same thing for every
location?
one last question: how can I get rid off the same fastcgi
lines. can’t I just define those globally? do I have to type the
same thing for every location?