ÍøÉϺöàÎÄÕ¶¼ÊǶą̀·þÎñÆ÷ ×ö»º´æ È»ºó·´Ïò´úÀíµ½ºǫ́·þÎñÆ÷
²»¹ý×÷Ϊһ¸öÇîÈËÄÄÀ´ÄÇô¶à·þÎñÆ÷
ËùÒÔÎÒÃÇÒªÈÃNGINX¼È×öWEB·þÎñÆ÷Ò²×ö»º´æ..
ÕâÑùͬÑùÒ²ÄÜÆðµ½¼ÓËÙЧ¹û..»º´æµ±¾²Ì¬ÓÃ..
ÊʺÏα¾²Ì¬µÄÍøվʹÓÃ..(PS:·Ï»°¾²Ì¬»¹ÐèÒª»º´æÂð~~~!)
http {
#»º´æÅäÖÃ
proxy_connect_timeout 5;
proxy_read_timeout 60;
proxy_send_timeout 5;
proxy_buffer_size 16k;
proxy_buffers 4 64k;
proxy_busy_buffers_size 128k;
proxy_temp_file_write_size 128k;
#ÁÙʱĿ¼ Ò»°ãûʲôÊý¾Ý ²»¹ýÒ»¶¨ÒªÓÐ
proxy_temp_path /cache/temp;
#»º´æĿ¼ Òª¸úÁÙʱĿ¼ÔÚͬһ·ÖÇø
#levels=1:2 Ŀ¼²ã¼¶ 1:2 /a/bc
#keys_zone=cache_one:100m µ¥Ò³×î´ó»º´æ100M
#inactive=7d ¹ýÆÚʱ¼ä 7Ìì
#max_size=50g »º´æ×î´ó¿Õ¼ä 50G
proxy_cache_path /cache/www_OOXX_com_cache levels=1:2 keys_zone=cache_one:100m inactive=7d max_size=50g;
#È»ºó ÏÖÔÚÅäÖÃÍøÕ¾·´Ïò´úÀí²¿·Ö
server {
location ~ \.html$ {
proxy_cache cache_one;# ÕâÀïÒª¸úproxy_cache_path ÀïµÄkeys_zone ¶ÔÓ¦
proxy_cache_valid 200 304 301 302 10d;
proxy_cache_valid any 1d;
proxy_cache_key $host$uri$is_args$args;
proxy_pass http://127.0.0.1:80;
proxy_redirect off;
proxy_set_header Host cache.www.OOXX.com;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
expires 3d;
break;
}
}
}
ÖصãÔÚ proxy_set_header Host cache.www.OOXX.com;
ÎÒÃÇÖØÐÂÉèÖõÄHost
È»ºóÔÚ·þÎñÆ÷µÄhost ÎļþÀïдÉÏ
127.0.0.1 cache.www.OOXX.com
²»ÓðÑcache.www.OOXX.com ×öA¼Ç¼µ½·þÎñÆ÷
ÕâÑùËÙ¶ÈÊÇ×î¿ì
È»ºóÅäÖÃ
cache.www.OOXX.com µÄ·ÃÎÊ
server {
listen 80;
server_name cache.www.OOXX.com;
root /data/www.OOXX.com;
rewrite ¡°^/article/(\d+).shtml$¡± /iCMS/show.php?id=$1 last;
rewrite ¡°^/article/(\d+)_(\d+).shtml$¡± /iCMS/show.php?id=$1&p=$2 last;
location ~ \.php$ {
include fcgi.conf;
}
error_page 500 502 503 504 /502.html;
error_page 404 400 403 /404.html;
}
ÍƼöÐÅÏ¢
- linuxÃüÁîѧϰ±Ê¼Ç£¨11£©£ºnlÃüÁî
- linuxÃüÁîѧϰ±Ê¼Ç£¨5£©£ºrmÃüÁî
- linuxÃüÁîѧϰ±Ê¼Ç£¨4£©£ºmkdirÃüÁî
- linuxÃüÁîѧϰ±Ê¼Ç£¨1£©£ºlsÃüÁî
- ½«CentosµÄyumÔ´¸ü»»Îª¹úÄڵİ¢ÀïÔÆÔ´
- ʹÓÃNginxÌí¼Óheader·ÀÖ¹ÍøÒ³±»frame
- linuxϼÓËÙscp´«Êä´óÎļþµÄËÙ¶È
- linuxϵͳÉ϶ÔnginxÈÕÖ¾·Ö¸î´¦Àí
- lnmp/nginxϵͳÕæÕýÓÐЧµÄͼƬ·ÀµÁÁ´ÍêÕûÉèÖÃÏê½â
- Í»ÆÆÊ®Íò²¢·¢µÄNginxµÄÅäÖü°ÓÅ»¯
ÈÈÃÅÐÅÏ¢
- nohup: redirecting stderr to stdou....
- ʹÓÃlog_formatΪNginx·þÎñÆ÷ÉèÖøüÏêϸµÄÈÕÖ¾¸ñʽ
- jquery easyUI--dataGrid-Json
- [Ô´´]·ÂGoogle Reader¡¢ÐÂÀË΢²©¡¢ÌÚѶ΢²©µ....
- ÀûÓÃKeepalived+mysql¹¹½¨¸ß¿ÉÓÃMySQLË«Ö÷×Ô¶....
- Nginx+keepalivedʵÏÖ¸ºÔؾùºâºÍË«»úÈȱ¸¸ß¿ÉÓÃ
- jqueryʵÏÖÒ³Ãæ¼ÓÔؽø¶ÈÌõ
- Rolling cURL: PHP²¢·¢×î¼Ñʵ¼ù
- codeigniter ·ÓÉÖÕ¼«ÓÅ»¯(url rewrite)
- linuxÏÂÉèÖÃsshÎÞÃÜÂëµÇ¼
×î½ü¸üÐÂ
- ²éÕÒ²¢É¾³ý.svnĿ¼Îļþ
- redis ÆßÖÖÊý¾ÝÀàÐ͵ÄʹÓó¡¾°
- linux ÏÂÎļþ¸´ÖƵ½windowsÏÂÂÒÂëµÄ½â¾ö°ì·¨
- nginx³öÏÖ502 upstream sent too big he....
- linuxÏÂsudoÅäÖÃÏê½â
- linuxÃüÁîѧϰ±Ê¼Ç£¨15£©£ºtailÃüÁî
- linuxÃüÁîѧϰ±Ê¼Ç£¨14£©£ºheadÃüÁî
- linuxÃüÁîѧϰ±Ê¼Ç£¨13£©£ºlessÃüÁî
- linuxÃüÁîѧϰ±Ê¼Ç£¨12£©£ºmoreÃüÁî
- ¼ÓÃÜËã·¨±È½Ï3DES AES RSA ECC MD5 SHA1µÈ
ÆÀÂÛ