atom feed11 messages in ru.sysoev.nginxRe: what's the simplest way to serve ...
FromSent OnAttachments
Ilan BerknerOct 2, 2010 4:05 pm 
António P. P. AlmeidaOct 2, 2010 4:23 pm 
Ilan BerknerOct 2, 2010 5:23 pm 
Edho P AriefOct 2, 2010 6:03 pm 
António P. P. AlmeidaOct 2, 2010 6:28 pm 
Ilan BerknerOct 2, 2010 9:30 pm 
Ilan BerknerOct 2, 2010 9:32 pm 
António P. P. AlmeidaOct 2, 2010 9:36 pm 
Ilan BerknerOct 2, 2010 9:38 pm 
Edho P AriefOct 2, 2010 9:40 pm 
Ilan BerknerOct 2, 2010 9:49 pm 
Subject:Re: what's the simplest way to serve php files through an alias?
From:Edho P Arief (edho@gmail.com)
Date:Oct 2, 2010 9:40:06 pm
List:ru.sysoev.nginx

On Sun, Oct 3, 2010 at 11:31 AM, Ilan Berkner <iber@gmail.com> wrote:

Thanks for the advice.  When I do it this way, I get an error (nginx error log): 2010/10/03 00:27:33 [error] 20239#0: *6447 "/usr/local/nagios/share/nagios/index.php" is not found (2: No such file or directory) so you can see that nginx is adding /nagios/ to the end of the root directory and so the file is not found (generating a 404 on the browser). What would be the correct way to address this issue?

location /nagios/ { root /usr/local/nagios/share; index index.php; }

use alias.

location ~ ^/nagios/(.*\.php)$ { alias /usr/local/nagios/share/$1; fastcgi_pass 127.0.0.1:9000; fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME $request_filename; include fastcgi_params; } location = /nagios { rewrite ^ /nagios/ permanent; } location /nagios/ { index index.php; alias /usr/local/nagios/share/; }