Introduction and Nginx Reverse Proxy

First, what is nginx?

  nginx is a high performance http server / reverse proxy server and e-mail (IMAP / POP3) proxy server. The program developed by Russian designer Igor Sysoev, the official test nginx support can support 50,000 concurrent links and and cpu, memory and other resource consumption is very low, running very stable, so now many well-known companies are using nginx.

Two, nginx scenarios

  1, http server. Nginx is a http http service can provide services independently. You can do a static web page server.
  2, the virtual host. It can be implemented in a single server virtualized multiple sites. Such as web hosting personal Web site.
  3, reverse proxy, load balancing. When traffic to your site reaches a certain level, a single server can not meet the user's request when demand requires multiple servers with a cluster can be used to make nginx reverse proxy. And multiple servers can take on average load, the situation will not be a high server load down a server while idle.
  

Third, the Windows environment installed Nginx

  1, first download Nginx: http://nginx.org/ 

  2, extract: nginx-windows

       

  3, double-click: nginx.exe

  4, access localhost

    

Fourth, the reverse proxy server

   Nginx, lvs, F5 (hardware), haproxy  

  ①lvs

    LVS is short for Linux Virtual Server, which means Linux virtual server is a virtual server cluster.

  ②F5 (hardware)

    F5 load balancing system supports N + M Cluster live framework, in the same Group of the load balancing apparatus can be freely assigned "Active" and "Standby" ratio, and may specify the takeover order Group in multiple load balancing device, which modes completely solve the problem of the cold standby mode 2 + 2 the two devices utilize low.

  ③haproxy

    HAProxy是一个使用C语言编写的自由及开放源代码软件,其提供高可用性、负载均衡,以及基于TCP和HTTP的应用程序代理。

五、反向代理

  反向代理(Reverse Proxy)方式是指以代理服务器来接受 internet 上的连接请求,然后将 请求转发给内部网络上的服务器,并将从服务器上得到的结果返回给 internet 上请求连接 的客户端,此时代理服务器对外就表现为一个反向代理服务器

六、实现反向代理

1、修改hosts文件

  

 2、修改conf文件下的nginx.conf文件

  

   

 3、编写jsp页面并Tomcat启动

  

 

 4、使用监听的域名访问

  通过反向代理,用户不用知道服务的ip和端口,也能正常的进行访问,通过代理服务器nginx开放一个对外的地址让用户进行访问,保证的真实服务器的安全性

  

 

 

Guess you like

Origin www.cnblogs.com/Zzzzn/p/12276182.html