Hi, I'd like to add some extra logic to the location rules in my Nginx server. I have an application that creates a binary file based on client requests. It only sends back a binary file using send_file method. The contents of the binary file depend on a short key that is sent in the body of a post request by the client. When the application makes the file it stores it in a given folder. I'd like to add a rule in Nginx so that depending on the key in the body it would either directly provide a file with a given name.bin (if existing in the folder). But if it is not existing it would actually use the rails app to generate it. I know I can check the body of the request with $request_body and use that in an if clause inside location rules. But how to make the decision to provide the file if existing or send the request to rails otherwise? Cheers.
on 2010-03-02 11:12
Please log in before posting. Registration is free and takes only a minute.
Existing account
(Switch to SSL-encrypted connection)
NEW: Do you have a Google/GoogleMail or Yahoo account? No registration required!
Log in with Google account | Log in with Yahoo account
Log in with Google account | Log in with Yahoo account
No account? Register here.