Thanks, <div><br></div><div>I tried it using "root" in the location, still no luck.</div><div><br></div><div>Here's my config (the parts that matter), the location /nagios/ is what's not working. What am I doing wrong? Thanks</div>
<div><br></div><div>http</div><div><div>{</div><div> root /var/www/html;</div><div> server</div><div> {</div><div> listen 10.0.1.163;</div><div> server_name <a href="http://dev.testsite.com">dev.testsite.com</a>;</div>
<div> location /nagios/</div><div> {</div><div> root /usr/local/nagios/share;</div><div> index index.php;</div><div> }</div><div> location /</div><div> {</div>
<div> index index.php;</div><div> error_page 404 = @joomla;</div><div> log_not_found off;</div><div> }</div><div> location @joomla</div><div> {</div><div>
rewrite ^(.*)$ /index.php?q=$1 last;</div><div> }</div><div><br></div><div> location ~ \.php$</div><div> {</div><div> include fcgi;</div><div> fastcgi_pass <a href="http://127.0.0.1:9000">127.0.0.1:9000</a>;</div>
<div> }</div><div><br></div><div> }</div><div>}</div></div><div><br></div><div><br><br><div class="gmail_quote">On Sat, Oct 2, 2010 at 7:23 PM, António P. P. Almeida <span dir="ltr"><<a href="mailto:appa@perusio.net">appa@perusio.net</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;"><div class="im">On 3 Out 2010 00h05 WEST, <a href="mailto:iberkner@gmail.com">iberkner@gmail.com</a> wrote:<br>
<br>
> we have a very simple configuration.<br>
><br>
> server block with location block<br>
><br>
> php is served through fastcgi and works fine<br>
><br>
> would like to add something like this:<br>
><br>
> location /nameofalias/<br>
> {<br>
> alias /usr/local/nameofalias;<br>
> }<br>
<br>
</div>This is now how alias is supposed to be used. In fact you're using<br>
alias like a root directive. Using alias is for when you want to use a<br>
certain base directory and don't want the URI to reflect that.<br>
<br>
location /foo {<br>
alias /var/www/nginx-default/barz;<br>
}<br>
<br>
Request for /foo/xpto.png is translated to<br>
<br>
/var/www/nginx-default/barz/xpto.png<br>
<div class="im"><br>
> but it does not seem to work, static files load fine.<br>
<br>
> the php location block is like this and works fine for the main<br>
> location block of "location /"<br>
><br>
> location ~ .php$<br>
> {<br>
> include fcgi;<br>
> fastcgi_pass <a href="http://127.0.0.1:9000" target="_blank">127.0.0.1:9000</a>;<br>
> }<br>
<br>
</div>You should have a fastcgi_pass directive where you want the PHP files<br>
to be handled.<br>
<br>
Also you need to escape the "." as in<br>
<br>
location ~ \.php$ {<br>
(...)<br>
}<br>
<br>
--- appa<br>
<br>
<br>
_______________________________________________<br>
nginx mailing list<br>
<a href="mailto:nginx@nginx.org">nginx@nginx.org</a><br>
<a href="http://nginx.org/mailman/listinfo/nginx" target="_blank">http://nginx.org/mailman/listinfo/nginx</a><br>
</blockquote></div><br></div>