Welcome! Log In Create A New Profile

Advanced

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

October 03, 2010 12:52AM
Thank you all for your responses.

I believe that the missing element in my case was:

alias /usr/local/nagios/share/$1;

in the nagios php processing location, I wasn't aware that I would have to
specify it there as well, but it makes sense now.

Thanks!

On Sun, Oct 3, 2010 at 12:40 AM, Edho P Arief <edhoprima@gmail.com> wrote:

> On Sun, Oct 3, 2010 at 11:31 AM, Ilan Berkner <iberkner@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/;
> }
>
> --
> O< ascii ribbon campaign - stop html mail - www.asciiribbon.org
>
> _______________________________________________
> nginx mailing list
> nginx@nginx.org
> http://nginx.org/mailman/listinfo/nginx
>
_______________________________________________
nginx mailing list
nginx@nginx.org
http://nginx.org/mailman/listinfo/nginx
Subject Author Posted

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

iberkner October 02, 2010 07:10PM

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

António P. P. Almeida October 02, 2010 07:36PM

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

iberkner October 02, 2010 08:28PM

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

edogawaconan October 02, 2010 09:08PM

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

iberkner October 03, 2010 12:34AM

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

iberkner October 03, 2010 12:42AM

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

António P. P. Almeida October 03, 2010 12:44AM

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

edogawaconan October 03, 2010 12:44AM

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

iberkner October 03, 2010 12:52AM

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

António P. P. Almeida October 02, 2010 09:38PM

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

iberkner October 03, 2010 12:36AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 154
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 500 on July 15, 2024
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready