Page level caching using nginx

Many of our dynamic sites contain rarely updated content (ex. blog archive page). By adding nginx server as proxy server infront of your apache server you can server those pages like static pages instead of running the page for every request, this will boost your site speed from 50% – 400%.

We need apache, nginx to work with this tutorial
To install nginx on debian please follow this link

http://timothybowler.com/2009/11/25/compiling-nginx-on-debian-lenny/

Note: Dont install using aptitude it contains older version where gzip and proxy module not available,

Modify apache ports.conf to run apache on port 8080

Add this lines to default site of nginx

server {
listen 80;
server_name debianzone.com;
location / {
proxy_pass http://debianzone.com:8080;
proxy_cache debianzone-cache;
proxy_cache_valid  200 302  60m;
proxy_cache_valid  404      1m;
}
} 

Add this in http section of nginx.conf

http {
proxy_cache_path  /var/www/cache levels=1:2 keys_zone=debianzone-cache:8m max_size=1000m inactive=600m;
proxy_temp_path /var/www/cache/tmp;
}

Tags: ,

About smanne

2 Responses to “Page level caching using nginx”

  1. ALFREDO:

    PillSpot.org. Canadian Health&Care.Special Internet Prices.No prescription online pharmacy.PillSpot.org. Vitamins@buy.online” rel=”nofollow”>.…

    Categories: Mental HealthWeight Loss.Anti-allergic/Asthma.Antidepressants.Pain Relief.Antiviral.Stomach.Blood Pressure/Heart.Vitamins/Herbal Supplements.Stop SmokingSkin Care.Antidiabetic.Anxiety/Sleep Aid.Eye Care.Antibiotics.Womens Health.Mens H…

  2. Truxedo:

    Truxedo http://cdkny2xb2cq.ACEHARDWAREE.INFO/tag/Truxedo+edwards+Edwards/ : edwards…

    edwards…

Leave a Reply