NGINX - performance HTTP server Support Forums

Please login or register.

Login with username, password and session length
Advanced search  

News:

Welcome to the Unofficial (YET) support forums for NGINX, a performance HTTP server.

Pages: [1]   Go Down

Author Topic: Using Nginx As Reverse-Proxy Server On High-Loaded Sites  (Read 760 times)

0 Members and 1 Guest are viewing this topic.

katmai

  • Administrator
  • Jr. Member
  • *****
  • Karma: 0
  • Offline Offline
  • Posts: 57
    • View Profile
Using Nginx As Reverse-Proxy Server On High-Loaded Sites
« on: November 30, 2007, 02:38:57 PM »
url=http://blog.kovyrin.net/wp-content/uploads/2006/05/general_c.png]Here[/url] you can see simple diagram of prourl=http://blog.kovyrin.net/wp-content/uploads/2006/05/algorithm_c.png]following:


Functional Algorithm

Let me bring your attention to interesting fact: If you only accelerate your site with described technique and do not want to create download control system, you do not need to modify any of your scripts on your backend server! They will work as in original configuration!

So, the last thing you need to boost your web server with nginx reverse proxying technique is following configuration file snipet:
Code: [Select]
server {
        listen       80;
        server_name  some-server.com www.server-name.com;

        access_log  logs/host.access.log  main;

        # Main location
        location / {
            proxy_pass         http://127.0.0.1:8080/;
            proxy_redirect     off;

            proxy_set_header   Host             $host;
            proxy_set_header   X-Real-IP        $remote_addr;
            proxy_set_header   X-Forwarded-For  $proxy_add_x_forwarded_for;

            client_max_body_size       10m;
            client_body_buffer_size    128k;

            proxy_connect_timeout      90;
            proxy_send_timeout         90;
            proxy_read_timeout         90;

            proxy_buffer_size          4k;
            proxy_buffers              4 32k;
            proxy_busy_buffers_size    64k;
            proxy_temp_file_write_size 64k;
        }

        # Static files location
        location ~* ^.+.(jpg|jpeg|gif|png|ico|css|zip|tgz|gz|rar|bz2|doc|xls|exe|pdf|ppt|txt|tar|mid|midi|wav|bmp|rtf|js)$ {
            root   /spool/www/members_ng;
        }

    }

Full version of sample config file you can get here.

Notice: If your backend scripts are using user IP addresses for some purposes, you will need to install mod_rpaf<Kovyrin[/urlHere<following:


Functional Algorithm

Let me bring your attention to interesting fact: If you only accelerate your site with described technique and do not want to create download control system, you do not need to modify any of your scripts on your backend server! They will work as in original configuration!

So, the last thing you need to boost your web server with nginx reverse proxying technique is following configuration file snipet:
Code: [Select]
server {
        listen       80;
        server_name  some-server.com www.server-name.com;

        access_log  logs/host.access.log  main;

        # Main location
        location / {
            proxy_pass         http://127.0.0.1:8080/;
            proxy_redirect     off;

            proxy_set_header   Host             $host;
            proxy_set_header   X-Real-IP        $remote_addr;
            proxy_set_header   X-Forwarded-For  $proxy_add_x_forwarded_for;

            client_max_body_size       10m;
            client_body_buffer_size    128k;

            proxy_connect_timeout      90;
            proxy_send_timeout         90;
            proxy_read_timeout         90;

            proxy_buffer_size          4k;
            proxy_buffers              4 32k;
            proxy_busy_buffers_size    64k;
            proxy_temp_file_write_size 64k;
        }

        # Static files location
        location ~* ^.+.(jpg|jpeg|gif|png|ico|css|zip|tgz|gz|rar|bz2|doc|xls|exe|pdf|ppt|txt|tar|mid|midi|wav|bmp|rtf|js)$ {
            root   /spool/www/members_ng;
        }

    }

Full version of sample config file you can get here.

Notice: If your backend scripts are using user IP addresses for some purposes, you will need to install mod_rpaf<Kovyrin
« Last Edit: November 30, 2007, 02:57:51 PM by katmai »
Logged

zlzqq

  • Newbie
  • *
  • Karma: 0
  • Offline Offline
  • Posts: 16
  • Just started
    • View Profile
Re: Using Nginx As Reverse-Proxy Server On High-Loaded Sites
« Reply #1 on: August 05, 2010, 07:32:43 AM »
The two pocket wow power leveling folder is a very important part of office stationery. Not only is the two pocket folder important wow power leveling in the office but it useful for students. The main use for the two pocket folder is to wow power leveling facilitate a faster, easier and proper organisation of documents. A business wow gold executive may use it to put together presentations in one pocket and other business documents in aion power leveling the second pocket. A student will find the two pocket folder useful in aion gold that he/she can organize, say, notes and homework in the different compartments but cheap wow power leveling in one overall folder. One can rest assured that all papers or documents can be accessed buy wow power leveling from one location. The two pocket folder can be customized to suit the different needs of different cheap wow gold individuals. Your two pocket folder can speak volumes about yourself e.g. it can represent your business aion power leveling if you own one.
Logged
Pages: [1]   Go Up
« previous next »
 

Page created in 0.035 seconds with 20 queries.