what's the simplest way to serve php files through an alias?

Ilan Berkner iberkner at gmail.com
Sun Oct 3 08:39:21 MSD 2010


btw, when I change the same configuration to alias and try to access
/nagios/, I get this error:

2010/10/03 00:36:06 [error] 7399#0: *6485 directory index of
"/usr/local/nagios/share" is forbidden

when I go to /nagios/index.php, I don't get an error in the log, but an
error in the browser, that says:
Oops! This link appears to be broken.


On Sun, Oct 3, 2010 at 12:31 AM, Ilan Berkner <iberkner at 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?
>
>
>
> On Sat, Oct 2, 2010 at 9:03 PM, Edho P Arief <edhoprima at gmail.com> wrote:
>
>> On Sun, Oct 3, 2010 at 7:23 AM, Ilan Berkner <iberkner at gmail.com> wrote:
>> > 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
>>
>> "not working"?
>>
>> - What are you expecting?
>> - What are you getting?
>>
>> > 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;
>> >         }
>>
>> as this one is located in different root path, you need additional php
>> block
>>
>> location ~ ^/nagios/.*\.php$ {
>> ...
>> }
>>
>> --
>> O< ascii ribbon campaign - stop html mail - www.asciiribbon.org
>>
>> _______________________________________________
>> nginx mailing list
>> nginx at nginx.org
>> http://nginx.org/mailman/listinfo/nginx
>>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://nginx.org/pipermail/nginx/attachments/20101003/866f483b/attachment.html>


More information about the nginx mailing list