http - Conceptual Rails / nginx -


nginx.conf The file is set up:

  root / public place ^ ~ / assets / {gzip_static on; Max Finish; Add_header cache-control public; } Location / {proxy_pass @rails_app #defined elsewhere}   

I get what it is doing: If the request matches the pattern then serve it directly from the root and provide the appropriate headers Add. I do not understand how this request arises. If I send some dynamic URL: / cheese / 1, then NGN will proxy this rail app that will send back a response. Now think that the response does not need an image to track the images in the output (in my installation), therefore nginx should serve it. But how does NGNG work it? I know that a different request has been generated for the image which will match the image location instructions and therefore avoid proxy_pass, but when / where is this request generated? Does the initial rail response tell the browser to make an additional request for the image, or does the train nginx directly for the request?

Nginx sees the results of the most matching results through defined trees. The first lookup is for "=" places, if there is no match, then it goes forward with the next "^ ~" and "root" the following.

The best example can be found here in the official docs:

In your case, all requests match "bypassing files" / Rails applications directly on file system Go back the comfort call to be served by proxy pass.

Comments

Popular posts from this blog

Pass DB Connection parameters to a Kettle a.k.a PDI table Input step dynamically from Excel -

multithreading - PhantomJS-Node in a for Loop -

c++ - MATLAB .m file to .mex file using Matlab Compiler -