Thank you for your suggestion, I remember the vigorous discussion that took place regarding this issue, in this particular case, this is a test / development system so I'm not as concerned as I normally would be.<div><br>
</div><div>In our production environment, things are a bit more rigid.</div><div><br></div><div><br><br><div class="gmail_quote">On Sat, Oct 2, 2010 at 9:29 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;">On 3 Out 2010 01h23 WEST, <a href="mailto:iberkner@gmail.com">iberkner@gmail.com</a> wrote:<br>
<br>
> [1 <multipart/alternative (7bit)>]<br>
> [1.1 <text/plain; ISO-8859-1 (quoted-printable)>]<br>
<div class="im">> Thanks,<br>
><br>
> I tried it using "root" in the location, still no luck.<br>
><br>
> Here's my config (the parts that matter), the location /nagios/ is<br>
> what's not working. What am I doing wrong? Thanks<br>
><br>
> http<br>
> {<br>
> root /var/www/html;<br>
> server<br>
> {<br>
> listen 10.0.1.163;<br>
> server_name <a href="http://dev.testsite.com" target="_blank">dev.testsite.com</a>;<br>
> location /nagios/<br>
> {<br>
> root /usr/local/nagios/share;<br>
> index index.php;<br>
> }<br>
> location /<br>
> {<br>
> index index.php;<br>
> error_page 404 = @joomla;<br>
> log_not_found off;<br>
> }<br>
> location @joomla<br>
> {<br>
> rewrite ^(.*)$ /index.php?q=$1 last;<br>
> }<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>
> }<br>
> }<br>
<br>
</div>For security reasons I suggest you constrain which exact locations can<br>
be used for FastCGI. Using a generic regex for any file with php<br>
extension opens a big security hole. This was discussed not long ago<br>
on the list.<br>
<br>
Instead you should enumerate which files are to be handled by FastCGI<br>
and return a 404 for every other file that is not enumerated. E.g.,<br>
<br>
location ~* ^/index\.php$ {<br>
<div class="im"> 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>And put at the end of the config file:<br>
<br>
# Any other attempt to access PHP files returns a 404.<br>
location ~* ^.+\.php$ {<br>
return 404;<br>
<div><div></div><div class="h5">}<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>
</div></div></blockquote></div><br></div>