Check if the file exists

I’m trying to check if the file exists before passing it to fastcgi but
I have not found as.
This is what I’m doing:
#if (!-f $document_root$fastcgi_script_name)

if (!-f $request_filename)
{
return 404;
}

I’ve tried try_files but not find a way.
The file is of the form:
/web/app.php/asd/fgh?ert=xx

If it let me pass over fastcgi returns the error:
No input file specified.

On Thu, Feb 20, 2014 at 01:34:10PM -0800, Felix Quintana wrote:

Hi there,

I’m trying to check if the file exists before passing it to fastcgi but I have
not found as.

I’ve tried try_files but not find a way.
The file is of the form:
/web/app.php/asd/fgh?ert=xx

What http request do you make?

What file on your filesystem do you want to check the existence of?

What file on your filesystem do you want to tell the fastcgi server
to process?

(The last two questions will probably have the same answer unless
chroots
are involved.)

What nginx variables hold the names of the files you care about?

Possibly fastcgi_split_path_info
(Module ngx_http_fastcgi_module) will be useful to you.

f

Francis D. [email protected]

What http request do you make?

https://localhost/web/app.php/asd/fgh

What file on your filesystem do you want to check the existence of?
What file on your filesystem do you want to tell the fastcgi server to process?
d:\symfony\web\app.php

What nginx variables hold the names of the files you care about?
I have no idea.

On Thu, Feb 20, 2014 at 02:01:22PM -0800, Felix Quintana wrote:

Hi there,

What http request do you make?

https://localhost/web/app.php/asd/fgh

What file on your filesystem do you want to check the existence of?
What file on your filesystem do you want to tell the fastcgi server to process?
d:\symfony\web\app.php

What nginx variables hold the names of the files you care about?
I have no idea.

http://nginx.org/en/docs/http/ngx_http_core_module.html#variables

See also
http://nginx.org/en/docs/http/ngx_http_core_module.html#try_files
and the usual way it is used for php/fastcgi checking.

With the other directive mentioned, you’ll possibly (untested!) be able
to use

try_files $fastcgi_script_name =404

in your fastcgi-processing location.

Good luck with it,

f

Francis D. [email protected]