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:Ilan Berkner (iber@gmail.com)
Date:Oct 2, 2010 5:23:04 pm
List:ru.sysoev.nginx

Thanks,

I tried it using "root" in the location, still no luck.

Here's my config (the parts that matter), the location /nagios/ is what's not working. What am I doing wrong? Thanks

http { root /var/www/html; server { listen 10.0.1.163; server_name dev.testsite.com; location /nagios/ { root /usr/local/nagios/share; index index.php; } location / { index index.php; error_page 404 = @joomla; log_not_found off; } location @joomla { rewrite ^(.*)$ /index.php?q=$1 last; }

location ~ \.php$ { include fcgi; fastcgi_pass 127.0.0.1:9000; }

On Sat, Oct 2, 2010 at 7:23 PM, António P. P. Almeida <ap@perusio.net>wrote:

On 3 Out 2010 00h05 WEST, iber@gmail.com wrote:

we have a very simple configuration.

server block with location block

php is served through fastcgi and works fine

would like to add something like this:

location /nameofalias/ { alias /usr/local/nameofalias; }

This is now how alias is supposed to be used. In fact you're using alias like a root directive. Using alias is for when you want to use a certain base directory and don't want the URI to reflect that.

location /foo { alias /var/www/nginx-default/barz; }

Request for /foo/xpto.png is translated to

/var/www/nginx-default/barz/xpto.png

but it does not seem to work, static files load fine.

the php location block is like this and works fine for the main location block of "location /"

location ~ .php$ { include fcgi; fastcgi_pass 127.0.0.1:9000; }

You should have a fastcgi_pass directive where you want the PHP files to be handled.

Also you need to escape the "." as in

location ~ \.php$ { (...) }

--- appa