#Add expires header for static content
location ~* \.(jpg|jpeg|gif|png|swf)$ {
if (-f $request_filename) {
root /date/wwwroot/linuxtone/;
expires 1d;
break;
}
}
log_format access '$remote_addr - $remote_user [$time_local] "$request" '
'$status $body_bytes_sent "$http_referer" '
'"$http_user_agent" $http_x_forwarded_for';
access_log /exp/nginxlogs/bbs.linuxtone_access.log access;
}
×¢:µÚ¶þÖÖ´úÀí·½Ê½
nginx ´¦ÀíÏÂͼƬ,htmlµÈ¾²Ì¬µÄ¶«Î÷.ÆäËü¶¯Ì¬ÓÉapache´¦Àí.Òò´ËapacheÒ²ÐèÒª×öһЩ²ÎÊýµ÷Õû.
ÉèÖÃͼƬµÈ¹ýÆÚʱ¼ä.»º½âÇëÇó.
Èç¹ûÔ´ÓënginxÔÚͬһ̨»úÆ÷½¨ÒéʹÓÃÈçÏ·½·¨:
location / {
proxy_pass http://192.168.1.4:8099/;
proxy_redirect default ;
}
Õë¶Ô²»Í¬µÄĿ¼½øÐдúÀí°ÑÏÂÃæµÄÅäÖ÷ŵ½¸ùĿ¼´úÀíµÄÉÏÃæ
location /linuxtone/ {
proxy_pass http://192.168.1.4:8099/linuxtone/;
proxy_redirect default ;
}
4 Ô´ÅäÖÃ
<VirtualHost 192.168.1.4:8099>
ServerAdmin liuyu105#gmail.com
DocumentRoot /date/wwwroot/linuxtone
ServerName bbs.linuxtone.com
ErrorLog logs/linuxtone_error_log
CustomLog "|/usr/local/sbin/cronolog logs/linuxtone_access_log.%Y%m%d" combined
</VirtualHost>
µÚ3²¿·Ö:Ô´µÄÓÅ»¯
1 apache-mpm.conf
<IfModule mpm_prefork_module>
StartServers 15
MinSpareServers 15
MaxSpareServers 30
ServerLimit 2536
MaxClients 2048
MaxRequestsPerChild 1500
</IfModule>
2 apache-keepalive
Timeout 120 #ÓënginxµÄ±£³ÖÒ»ÖÁ
KeepAlive On
MaxKeepAliveRequests 400
KeepAliveTimeout 7
ÍƼöÐÅÏ¢
- 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µÈ
ÆÀÂÛ