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:
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:
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