Nginx (2. Reverse Proxy)

Source: Internet
Author: User

Reverse Proxy is one of the most important features of nginx. Opposite to forward proxy, it proxy is not a client, but a target source, that is, the target source of my proxy satisfies the request given by the client.

The simple configuration of reverse proxy in nginx is as follows:

Server {Listen 801; SERVER_NAME localhost; # charset koi8-r; # access_log logs/host. Access. Log main; Location/{proxy_pass http: // 127.0.0.1: 3000/; proxy_redirect default ;}

If the client accesses nginx's localhost: 801 port, its request will be mapped to localhost: 3000 port.

You can view the nginx access log as follows:

"Get/stylesheets/style.css HTTP/1.1" 200 117 "http: // localhost: 801/" "Mozilla/5.0 (Windows NT 6.1; win64; x64) applewebkit/537.36 (khtml, like gecko) Chrome/41.0.2251.0 Safari/537.36"

 

Nginx (2. Reverse Proxy)

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.