Nginx as a simple proxy server (Windows environment)

Source: Internet
Author: User
Tags create index

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)

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.