How to build a Web server using Nginx to build a reverse proxy server

Source: Internet
Author: User

Reprint how to build a Web server using Nginx to build a reverse proxy server: http://blog.csdn.net/w13770269691/article/details/6977727

Introduction: Recently, the company has a server suffered a DDoS attack, traffic above 70M, because the server hardware configuration is high, so do not need a DDoS hardware firewall. But we need to know, IDC room is certainly not allowed this traffic has been in this high, because there is no specific knowledge of the subsequent attacks will be the amount of traffic, if the traffic is too large will lead to the entire IDC network paralysis. We all know that the north of the data center and the south of the data center from the bandwidth export to the south most of the computer room is fully capable of carrying DDoS attacks, Dongguan's telecommunications room is good. Some friends have said that in the face of such an attack can be in the southern Telecom in a server , and then a reverse proxy; what puzzled me is that if I put a server in the south, then the southern Telecom server On the reverse proxy, the north of the user access speed will certainly be very slow (south of the room for telecommunications, more than two lines, Beijing is a double or BGP line). Well, we go to the back, no matter how the reverse proxy is to achieve, first of all we have to solve is how to build a reverse proxy server , lest cramming.

First, let's take a look at what a reverse proxy is, such as: When a client makes a request to the site, the request goes to the proxy server , and then the proxy server forwards the request to the server on the internal network, and the server The result is returned to the customer requesting connection on the Internet, for the user who accesses the server , the proxy server is represented as a server at this time. We can also reverse proxy Some policies are added to the server , which protects the Web server from reaching the Web server Even if the user wants to invade the site; reverse proxy Server The backend can also be placed on multiple Web servers , which can reduce the pressure on the site, play a role in the cluster

We all know that Nginx is a very good program, its biggest advantage is to be able to carry high concurrent connections, this time we use Nginx to do a reverse proxy server

  Environment Description: The reverse proxy server is a Linux system with Nginx installed; TheWeb server is a Windows system with IIS

First, we set the reverse proxy on Nginx, modify the Nginx configuration file, the following sections are removed

When the deletion is complete, add the following: The server name needs to set the domain name in the real environment, because we actually visit the website rarely use Ip,proxy_pass as the address of the Web server, such as Web server's website with 8080 port, then our Proxy_pass The format is

After the setup is complete, perform the/usr/local/nginx/sbin/nginx-t check if the configuration is normal, if shown: The Configuration file/usr/local/nginx/conf/nginx.conf syntax is OK configuration file/usr/local/nginx/conf/nginx.conf test is successful normal, otherwise modified by error. After checking the configuration file, kill the Nginx process and restart Nginx. This time the client access 192.168.1.20 this server is the 192.168.1.10 server above the content.

For example, when a user accesses 192.168.1.20, IIS 192.168.1.10 this server logs an access log that is displayed for 192.168.1.20 access instead of the client

How to build a Web server using Nginx to build a reverse proxy server

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.