Welcome! Log In Create A New Profile

Advanced

proxy_pass only if a file exists

April 30, 2013 10:25AM
I need to make sure a file actually exists before proxy_pass-ing the request to an upstream server. I don't serve existing files directly using Nginx because there are some application-specific logic i need to perform on the application server for such requests.

I've looked at try_files, but it seems like it will serve the file straightaway once it is found, which is not what I want here. Another way is to use if (!-f $request_filename), but as mentioned here: http://wiki.nginx.org/Pitfalls#Check_IF_File_Exists, it's not a terrible way to check the existence of a file.

Is there a feasible yet efficient way?
SubjectAuthorPosted

proxy_pass only if a file exists

mrtnApril 30, 2013 10:25AM

Re: proxy_pass only if a file exists

mrtnApril 30, 2013 12:44PM

Re: proxy_pass only if a file exists

Francis DalyMay 04, 2013 05:26PM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 56
Record Number of Users: 7 on March 06, 2014
Record Number of Guests: 184 on July 08, 2014
Powered by nginx    Powered by FreeBSD    PHP Powered    Powered by Percona     ipv6 ready