Nginx A frequent application is acting as a proxy server, accepting customer requests by the Nginx Proxy server, and sending customer requests to the application server for processing, accepting the response of the application server, and then sending the response to the customer.
Now a scenario is to do when the customer requests a picture resource, directly from the Nginx from the local, if the request JSP resource, Nginx sends the request to the Tomcat server, and receives the Tomcat server response, and finally sends the response to the customer.
1. Create a web App. Create index.jsp and hello.jsp in the root directory
2. Deploy this web app to Tomcat
3, Configuration nginx.conf
Location/ { # handled by Tomcat proxy_pass http://localhost:8080/;} ~\. (Gif|jpg| png) $ { # directly from the local get root e:/Study/nginx/nginx-1.7. 6/data/image;}
4. Access to JSP and pictures
Nginx as a simple proxy server (Windows environment)