Welcome! Log In Create A New Profile

Advanced

Re: How to remove the "IF" in this fcgi config

February 21, 2013 12:56PM
On Feb 21, 2013, at 21:48 , Ed W wrote:

> Hi, I'm trying to setup a php app using fpm (owncloud).
>
> I am trying to match urls which can all over the filesystem and of the form: something.php/some/path?params
>
> So far I have something like this:
>
>
> location / {
> try_files $uri $uri/ index.php;
> }
>
> location ~ ^(?P<script_name>.+\.php)(/|$) {
> fastcgi_split_path_info ^(.+\.php)(/.*)$;
> if (!-f $script_name) {
> #return 404;
> break;
> }
> include fastcgi2.conf;
> fastcgi_pass 127.0.0.1:9000;
> }
>
> where:
> fastcgi2.conf is a copy of fastcgi.conf with one change:
> fastcgi_param REQUEST_URI $uri$is_args$args;
>
>
> How do I avoid using an IF here to check that the php file really exists? Also, why does uncommenting the return 404 cause some kind of breakage (not even sure I understand exactly what happens? Seems like the paths get broken?)

location ~ ^(?<script_name>.+\.php)(?<path_info>/|$) {
try_files $script_name =404;

include fastcgi2.conf;
fastcgi_param PATH_INFO $path_info;
fastcgi_pass 127.0.0.1:9000;
}


--
Igor Sysoev
http://nginx.com/support.html

_______________________________________________
nginx mailing list
nginx@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx
Subject Author Posted

How to remove the "IF" in this fcgi config

Ed W February 21, 2013 12:50PM

Re: How to remove the "IF" in this fcgi config

Igor Sysoev February 21, 2013 12:56PM

Re: How to remove the "IF" in this fcgi config

Ed W February 21, 2013 02:10PM

Re: How to remove the "IF" in this fcgi config

Francis Daly February 22, 2013 03:12PM

Re: How to remove the "IF" in this fcgi config

Valentin V. Bartenev February 22, 2013 05:08PM

Re: How to remove the "IF" in this fcgi config

Francis Daly February 23, 2013 08:42AM

Re: How to remove the "IF" in this fcgi config

csg February 24, 2013 02:42PM

Re: How to remove the "IF" in this fcgi config

Ed W February 25, 2013 04:22PM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 169
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready