Discover Centmin Mod today
Register Now

Nginx Reverse Proxy using NGINX Plus

Discussion in 'Nginx and PHP-FPM news & discussions' started by eva2000, May 25, 2014.

Tags:
  1. eva2000

    eva2000 Administrator Staff Member

    30,195
    6,789
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +10,144
    Local Time:
    2:13 PM
    Nginx 1.13.x
    MariaDB 5.5
    NGINX has gained justifiable fame as a very high performance web server and I think many people realize that NGINX can also be used as a reverse proxy, but many people may not be aware of just what a powerful reverse proxy NGINX can be.


    What is a Reverse Proxy:

    First, what is a reverse proxy server? Let’s take a step back and ask, what is a proxy server? I think Wikipedia has a good definition:

    A proxy server is a server (a computer system or an application) that acts as an intermediary for requests from clients seeking resources from other servers.​

    So a proxy server sits in between a client and the actual server that contains the data the client is looking for. To the client, the proxy server appears as if it is the actual backend server and to the backend server the proxy server appears as a client. To define a reverse proxy server we go back to Wikipedia:

    A reverse proxy is a type of proxy server that retrieves resources on behalf of a client from one or more servers.​

    The difference between a proxy server and a reverse proxy server, is that instead of the client connecting to single backend server through the proxy server there may be more than one server sitting behind the reverse proxy server and the reverse proxy server decides which of the backend servers to use for each request.

    What are the Benefits of using a Reverse Proxy:

    Why would you want to use a reverse proxy server? There are number of advantages to adding a reverse proxy including:

    • Concurrency

    Internet applications often involve large numbers of clients each opening multiple connections resulting in a very large number of connections to the backend servers. Many web servers and application servers do not handle large numbers of connections well (NGINX when used as web server is an exception) so adding a reverse proxy that is able to do a better job of handling these connections can produce a marked increase in the performance of the backend servers.​

    • Resiliency

    If clients are connecting directly to a backend server and the backend server suffers a failure then all clients connected to or trying to connect to that server will see their requests fail. A reverse proxy, when put in front of the backend servers, can monitor the health of the backend servers and if it detects a failure in a backend server will stop sending requests to that backend server until the server is healthily again.​

    • Scalability

    By putting a reverse proxy in front of a pool of backend servers, it is possible to add and remove servers from the pool to react to load.​

    • Layer 7 routing

    Because a reverse proxy sits between the clients and the backend servers and sees all the traffic it can make intelligent decisions as where to send each request, and it can also modify requests and responses. This can include making a decision based on a header, part of a URL, the geographic location of the client, etc.​

    • Caching

    A reverse proxy is a great place to do caching as it can be much more efficient then sending all requests to the backend servers and having each backend server build its own cache.​

    • More

    By sitting in front of the backend servers, a reverse proxy can include many more features such as traffic shaping based on bandwidth or request rate, connection limiting, integration with various authorization schemes, activity monitoring and much more.​

    Using NGINX Plus as a Reverse Proxy:

    NGINX Plus introduces even more features so now, in additional to its renowned web server capabilities, NGINX Plus is a full featured Application Delivery Controller (ADC) able to take the place of proprietary hardware appliances.

    Here are just some of the features available in NGINX Plus:

    Load Balancing:

    There are multiple load balancing algorithms to choose from, both weighted and unweighted and session persistence is also supported. NGINX Plus can load balance HTTP, HTTPS, SPDY, WebSocket, FastCGI, SCGI, uwsgi and memcached. Read more.

    Health Checks:

    Both passive and active monitoring of backend server health is supported. If NGINX Plus is unable to connect to a node, that node will be marked as down. Active health checks can also be configured to run periodically against backend nodes. In addition, the slow start feature can be used so that when a node becomes available, NGINX Plus will slowly ramp up traffic to that node to avoid overwhelming a node that has just come online. Read more.

    Request Routing:

    Traffic can be routed based on any part of a request, such as the client IP address, host name, URI, query string, headers, etc.

    Request and Response Rewriting:

    Any part of a request or response, including headers, body and URI can be modified. This includes the ability to add, change and delete headers.

    Caching:

    Responses can be cached, and what types of content to cache and for how long can be configured as well as being able to purge items from the cache. Read more.

    Compression:

    Gzip compression is supported, with fine grained control over what content to compress and when to use compression. Read more.

    SSL:

    SSL decryption and encryption are supported and decryption can be done for many domain names using different certificates. Read more.

    Activity Monitoring and Logging:

    NGINX Plus statistics are available via a simple HTTP request that provides a JSON response. A webpage is provided to display these statistics, but they can also be fed to other systems. Custom formatted logs can be configured for both local logging and export to syslog. Read more.

    And Much More:

    NGINX has many more features, such as support for video streaming, mail proxy support, Geo-IP support, graceful restarts and upgrades without downtime, traffic shaping, connection limiting, and much more. Please visit http://nginx.com and http://nginx.org/en/docs for more information.

    The post Reverse Proxy using NGINX Plus appeared first on NGINX.

    Continue reading...
     
    • Like Like x 1
  2. Oxide

    Oxide Active Member

    504
    29
    28
    Mar 19, 2015
    Ratings:
    +54
    Local Time:
    2:13 PM
    Hi. How would I go about to use nginx plus with cent min?

    Also main difference between nginx and nginx plus.. I like the Json API but what about amount of requests or layer 7 ddos
     
  3. eva2000

    eva2000 Administrator Staff Member

    30,195
    6,789
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +10,144
    Local Time:
    2:13 PM
    Nginx 1.13.x
    MariaDB 5.5
  4. Oxide

    Oxide Active Member

    504
    29
    28
    Mar 19, 2015
    Ratings:
    +54
    Local Time:
    2:13 PM
    yea, i most likely wanted that stat through json but $1500/yr is too much for just that
     
    • Like Like x 1