Hello, I think that I understand most of aspects related to nginx and reverse proxy mechanism itself, but I found one thing that is incomprehensible for me.
According to this schematic "http://oi61.tinypic.com/29p3zfb.jpg" when user tries to access my website i.e "website.com" the request to reverse proxy is send (in this case for nginx) and nginx return / serve static files (i.e css files,images) immediately and pass request for dynamic content i.e php script to beckend server. It sound cool but my question is how nginx knows which static file to serve without answer from backend server first ? It is impossible since script determines which page show to user and therefore which images, style sheets, js script and so on should be served.
Can you explain how it works ?
regards.
According to this schematic "http://oi61.tinypic.com/29p3zfb.jpg" when user tries to access my website i.e "website.com" the request to reverse proxy is send (in this case for nginx) and nginx return / serve static files (i.e css files,images) immediately and pass request for dynamic content i.e php script to beckend server. It sound cool but my question is how nginx knows which static file to serve without answer from backend server first ? It is impossible since script determines which page show to user and therefore which images, style sheets, js script and so on should be served.
Can you explain how it works ?
regards.