ʹÓøºÔؾùºâµÄ»°,¿ÉÒÔÐÞ¸ÄÅäÖÃhttp½ÚµãÈçÏ£º
#É趨http·þÎñÆ÷£¬ÀûÓÃËüµÄ·´Ïò´úÀí¹¦ÄÜÌṩ¸ºÔؾùºâÖ§³Ö http { #É趨mimeÀàÐÍ,ÀàÐÍÓÉmime.typeÎļþ¶¨Òå include /etc/nginx/mime.types; default_type application/octet-stream; #É趨ÈÕÖ¾¸ñʽ access_log /var/log/nginx/access.log; #Ê¡ÂÔÉÏÎÄÓеÄһЩÅäÖýڵã #¡£¡£¡£¡£¡£¡£¡£¡£¡£¡£ #É趨¸ºÔؾùºâµÄ·þÎñÆ÷Áбí upstream mysvr { #weigth²ÎÊý±íʾȨֵ£¬È¨ÖµÔ½¸ß±»·ÖÅäµ½µÄ¼¸ÂÊÔ½´ó server 192.168.8.1x:3128 weight=5 max_fails=2 fail_timeout=30s; #±¾»úÉϵÄSquid¿ªÆô3128¶Ë¿Ú,²»ÊDZØÐëÒªsquid server 192.168.8.2x:80 weight=1 max_fails=2 fail_timeout=30s; server 192.168.8.3x:80 weight=6 max_fails=2 fail_timeout=30s; } upstream mysvr2 { #weigth²ÎÊý±íʾȨֵ£¬È¨ÖµÔ½¸ß±»·ÖÅäµ½µÄ¼¸ÂÊÔ½´ó server 192.168.8.x:80 weight=1 max_fails=2 fail_timeout=30s; server 192.168.8.x:80 weight=6 max_fails=2 fail_timeout=30s; } #µÚÒ»¸öÐéÄâ·þÎñÆ÷ server { #ÕìÌý192.168.8.xµÄ80¶Ë¿Ú listen 80; server_name 192.168.8.x; #¶Ôaspxºó׺µÄ½øÐиºÔؾùºâÇëÇó location ~ .*\.aspx$ { #¶¨Òå·þÎñÆ÷µÄĬÈÏÍøÕ¾¸ùĿ¼λÖà root /root; #¶¨ÒåÊ×Ò³Ë÷ÒýÎļþµÄÃû³Æ index index.php index.html index.htm; #ÇëÇóתÏòmysvr ¶¨ÒåµÄ·þÎñÆ÷Áбí proxy_pass http://mysvr ; #ÒÔÏÂÊÇһЩ·´Ïò´úÀíµÄÅäÖÿÉɾ³ý. proxy_redirect off; #ºó¶ËµÄWeb·þÎñÆ÷¿ÉÒÔͨ¹ýX-Forwarded-For»ñÈ¡Óû§ÕæʵIP 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; #nginx¸úºó¶Ë·þÎñÆ÷Á¬½Ó³¬Ê±Ê±¼ä(´úÀíÁ¬½Ó³¬Ê±) proxy_connect_timeout 90; #Á¬½Ó³É¹¦ºó£¬ºó¶Ë·þÎñÆ÷ÏìӦʱ¼ä(´úÀí½ÓÊÕ³¬Ê±) proxy_read_timeout 90; #ÉèÖôúÀí·þÎñÆ÷£¨nginx£©±£´æÓû§Í·ÐÅÏ¢µÄ»º³åÇø´óС proxy_buffer_size 4k; #proxy_buffers»º³åÇø£¬Íøҳƽ¾ùÔÚ32kÒÔϵĻ°£¬ÕâÑùÉèÖà proxy_buffers 4 32k; #¸ß¸ººÉÏ»º³å´óС£¨proxy_buffers*2£© proxy_busy_buffers_size 64k; #É趨»º´æÎļþ¼Ð´óС£¬´óÓÚÕâ¸öÖµ£¬½«´Óupstream·þÎñÆ÷´« proxy_temp_file_write_size 64k; } } }
ÍƼöÐÅÏ¢
- 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µÈ
ÆÀÂÛ