{"id":3089,"date":"2011-10-27T11:29:58","date_gmt":"2011-10-27T03:29:58","guid":{"rendered":"https:\/\/www.icocean.com\/wp\/?p=3089"},"modified":"2011-10-27T11:30:01","modified_gmt":"2011-10-27T03:30:01","slug":"%e6%9e%84%e6%9e%b6%e9%ab%98%e6%80%a7%e8%83%bdweb%e7%bd%91%e7%ab%99%e7%9a%84%e5%87%a0%e7%82%b9%e7%9f%a5%e8%af%86","status":"publish","type":"post","link":"https:\/\/www.icocean.com\/blog\/?p=3089","title":{"rendered":"\u6784\u67b6\u9ad8\u6027\u80fdWEB\u7f51\u7ad9\u7684\u51e0\u70b9\u77e5\u8bc6"},"content":{"rendered":"<p><strong>\u524d\u8a00\uff1a<\/strong><\/p>\n<p>\u5bf9\u4e8e\u6784\u67b6\u9ad8\u6027\u80fd\u7684web\u7f51\u7ad9\u5927\u5bb6\u90fd\u5f88\u611f\u5174\u8da3\uff0c\u672c\u6587\u4ece\u51e0\u70b9\u7c97\u8c08\u9ad8\u6027\u80fdweb\u7f51\u7ad9\u9700\u8981\u8003\u8651\u7684\u95ee\u9898\u3002<\/p>\n<p><strong>HTML\u9759\u6001\u5316<\/strong><\/p>\n<p>\u4ec0\u4e48\u662fhtml\u9759\u6001\u5316\uff1f<\/p>\n<p>\u8bf4\u5f97\u7b80\u5355\u70b9\uff0c\u5c31\u662f\u628a\u6240\u6709\u4e0d\u662f.htm\u6216\u8005.html\u7684\u9875\u9762\u6539\u4e3a.htm\u6216\u8005.html<!--more--><\/p>\n<p>1.\u7eaf\u9759\u6001\u9875\u9762<\/p>\n<p>\u5f53\u7528\u6237\u8bbf\u95ee\u662f\uff0c\u4e0d\u9700\u8981\u7ecf\u8fc7\u670d\u52a1\u5668\u89e3\u6790\uff0c\u76f4\u63a5\u5c31\u53ef\u4ee5\u4f20\u9001\u5230\u5ba2\u6237\u7aef\uff0c\u6b64\u7c7b\u578b\u7684\u9875\u9762\uff0c\u7531\u4e8e\u4e0d\u9700\u8981\u89e3\u6790\u5c31\u80fd\u76f4\u63a5\u8bbf\u95ee\uff0c\u4e00\u822c\u60c5\u51b5\u4e0b\uff0c\u6bd4\u52a8\u6001\u9875\u9762\u7684\u6267\u884c\u901f\u5ea6\u5feb\u3002<\/p>\n<p>2.\u9759\u6001\u5316<\/p>\n<p>\u9875\u9762\u9759\u6001\u5316\u5c31\u662f\u7528\u52a8\u9759\u7ed3\u5408\u7684\u65b9\u5f0f\u5c06\u52a8\u6001\u7f51\u7ad9\u751f\u6210\u9759\u6001\u7f51\u7ad9\u6765\u4fdd\u5b58\u3002\u8fd9\u662f\u5b9e\u5b9e\u5728\u5728\u7684html\u6587\u4ef6\uff0c\u4e5f\u5c31\u662f\u9759\u6001\u9875\u9762\u3002<\/p>\n<p>3. \u4f2a\u9759\u6001\u65b9\u6cd5\uff08Url\u9759\u6001\u5316\uff09<\/p>\n<p>\u4f2a\u9759\u6001\u4e0d\u662f\u771f\u6b63\u610f\u4e49\u4e0a\u7684\u9759\u6001\u5316\uff0c\u5b83\u53ea\u662f\u5229\u7528\u67d0\u79cd\u65b9\u6cd5\u5c06\u8bbf\u95ee\u7684\u8def\u5f84\u4e5f\u5c31\u662furl\u5730\u5740\u8f6c\u6362\u6210\u4e3a.html\u4e3a\u540e\u7f00\u7684\u6587\u4ef6\uff0c\u4f46\u662f\u5b9e\u9645\u4e0a\uff0c\u6587\u4ef6\u672c\u8eab\u8fd8\u662f\u4ee5\u539f\u6765\u7684\u540e\u7f00\u4fdd\u5b58\u5728\u670d\u52a1\u5668\u4e0a\u3002<\/p>\n<p><strong>HTML\u9759\u6001\u5316\u7684\u4f18\u70b9<\/strong><\/p>\n<p>\u4e00\u3001\u51cf\u8f7b\u670d\u52a1\u5668\u8d1f\u62c5\u3002<\/p>\n<p>\u4e8c\u3001\u6709\u5229\u4e8e\u641c\u7d22\u5f15\u64ce\u4f18\u5316seo\uff0cBaidu\u3001Google\u90fd\u4f1a\u4f18\u5148\u6536\u5f55\u9759\u6001\u9875\u9762\uff0c\u4e0d\u4ec5\u88ab\u6536\u5f55\u7684\u5feb\u8fd8\u6536\u5f55\u7684\u5168\uff1b<\/p>\n<p>\u4e09\u3001\u52a0\u5feb\u9875\u9762\u6253\u5f00\u901f\u5ea6\uff0c\u9759\u6001\u9875\u9762\u65e0\u9700\u8fde\u63a5\u6570\u636e\u5e93\u6253\u5f00\u901f\u5ea6\u8f83\u52a8\u6001\u9875\u9762\u6709\u660e\u663e\u63d0\u9ad8\uff1b<\/p>\n<p>\u56db\u3001HTML\u9875\u9762\u4e0d\u4f1a\u53d7\u7a0b\u5e8f\u76f8\u5173\u6f0f\u6d1e\u7684\u5f71\u54cd<\/p>\n<p><strong>PHP\u4e2d\u7684html\u9759\u6001\u5316\u7684\u6a21\u7248<\/strong><\/p>\n<p>\u8457\u540d\u7684smarty\u6a21\u7248\u5c31\u662f\u4e00\u4e2a\u5b9e\u73b0\u5f88\u597d\u7684html\u9759\u6001\u5316\u7684\u6a21\u7248\uff0csmarty\u7684\u4f18\u70b9\u5c31\u662f\u901f\u5ea6\u5feb\uff0c\u9ad8\u6548\u7f13\u5b58\u548chtml\u9759\u6001\u5316\uff0c\u6a21\u7248\u5206\u79bb<\/p>\n<p><strong>MVC\u5f00\u53d1\u6a21\u5f0f<\/strong><\/p>\n<p>MVC\u662f\u4e09\u4e2a\u5355\u8bcd\u7684\u7f29\u5199\uff0c\u5206\u522b\u4e3a\uff1a \u6a21\u578b\uff08Model\uff09\uff0c\u89c6\u56fe\uff08View\uff09\u548c\u63a7\u5236Controller\uff09<\/p>\n<p>MVC\u662f\u4e00\u4e2a\u8bbe\u8ba1\u6a21\u5f0f\uff0c\u5b83\u5f3a\u5236\u6027\u7684\u4f7f\u5e94\u7528\u7a0b\u5e8f\u7684\u8f93\u5165\u3001\u5904\u7406\u548c\u8f93\u51fa\u5206\u5f00\u3002\u4f7f\u7528MVC\u5e94\u7528\u7a0b\u5e8f\u88ab\u5206\u6210\u4e09\u4e2a\u6838\u5fc3\u90e8\u4ef6\uff1a\u6a21\u578b\u3001\u89c6\u56fe\u3001\u63a7\u5236\u5668\u3002\u5b83\u4eec\u5404\u81ea\u5904\u7406\u81ea\u5df1\u7684\u4efb\u52a1\u3002<\/p>\n<p>\u89c6\u56fe<\/p>\n<p>\u89c6\u56fe\u662f\u7528\u6237\u770b\u5230\u5e76\u4e0e\u4e4b\u4ea4\u4e92\u7684\u754c\u9762\u3002\u5bf9\u8001\u5f0f\u7684Web\u5e94\u7528\u7a0b\u5e8f\u6765\u8bf4\uff0c\u89c6\u56fe\u5c31\u662f\u7531HTML\u5143\u7d20\u7ec4\u6210\u7684\u754c\u9762\uff0c\u5728\u65b0\u5f0f\u7684Web\u5e94\u7528\u7a0b\u5e8f\u4e2d\uff0cHTML\u4f9d\u65e7\u5728\u89c6\u56fe \u4e2d\u626e\u6f14\u7740\u91cd\u8981\u7684\u89d2\u8272\uff0c\u4f46\u4e00\u4e9b\u65b0\u7684\u6280\u672f\u5df2\u5c42\u51fa\u4e0d\u7a77\uff0c\u5b83\u4eec\u5305\u62ecMacromedia Flash\u548c\u8c61XHTML\uff0cXML\/XSL\uff0cWML\u7b49\u4e00\u4e9b\u6807\u8bc6\u8bed\u8a00\u548cWeb services.<\/p>\n<p>\u5982\u4f55\u5904\u7406\u5e94\u7528\u7a0b\u5e8f\u7684\u754c\u9762\u53d8\u5f97\u8d8a\u6765\u8d8a\u6709\u6311\u6218\u6027\u3002MVC\u4e00\u4e2a\u5927\u7684\u597d\u5904\u662f\u5b83\u80fd\u4e3a\u4f60\u7684\u5e94\u7528\u7a0b\u5e8f\u5904\u7406\u5f88\u591a\u4e0d\u540c\u7684\u89c6\u56fe\u3002\u5728\u89c6\u56fe\u4e2d\u5176\u5b9e\u6ca1\u6709\u771f\u6b63\u7684\u5904\u7406\u53d1\u751f\uff0c\u4e0d\u7ba1\u8fd9\u4e9b\u6570\u636e\u662f\u8054\u673a\u5b58\u50a8\u7684\u8fd8\u662f\u4e00\u4e2a\u96c7\u5458\u5217\u8868\uff0c\u4f5c\u4e3a\u89c6\u56fe\u6765\u8bb2\uff0c\u5b83\u53ea\u662f\u4f5c\u4e3a\u4e00\u79cd\u8f93\u51fa\u6570\u636e\u5e76\u5141\u8bb8\u7528\u6237\u64cd\u7eb5\u7684\u65b9\u5f0f\u3002<\/p>\n<p>\u6a21\u578b<\/p>\n<p>\u6a21\u578b\u8868\u793a\u4f01\u4e1a\u6570\u636e\u548c\u4e1a\u52a1\u89c4\u5219\u3002\u5728MVC\u7684\u4e09\u4e2a\u90e8\u4ef6\u4e2d\uff0c\u6a21\u578b\u62e5\u6709\u6700\u591a\u7684\u5904\u7406\u4efb\u52a1\u3002\u4f8b\u5982\u5b83\u53ef\u80fd\u7528\u8c61EJBs\u548cColdFusion Components\u8fd9\u6837\u7684\u6784\u4ef6\u5bf9\u8c61\u6765\u5904\u7406\u6570\u636e\u5e93\u3002\u88ab\u6a21\u578b\u8fd4\u56de\u7684\u6570\u636e\u662f\u4e2d\u7acb\u7684\uff0c\u5c31\u662f\u8bf4\u6a21\u578b\u4e0e\u6570\u636e\u683c\u5f0f\u65e0\u5173\uff0c\u8fd9\u6837\u4e00\u4e2a\u6a21\u578b\u80fd\u4e3a\u591a\u4e2a\u89c6\u56fe\u63d0\u4f9b\u6570\u636e\u3002\u7531\u4e8e\u5e94\u7528\u4e8e \u6a21\u578b\u7684\u4ee3\u7801\u53ea\u9700\u5199\u4e00\u6b21\u5c31\u53ef\u4ee5\u88ab\u591a\u4e2a\u89c6\u56fe\u91cd\u7528\uff0c\u6240\u4ee5\u51cf\u5c11\u4e86\u4ee3\u7801\u7684\u91cd\u590d\u6027\u3002<\/p>\n<p>\u63a7\u5236\u5668<\/p>\n<p>\u63a7\u5236\u5668\u63a5\u53d7\u7528\u6237\u7684\u8f93\u5165\u5e76\u8c03\u7528\u6a21\u578b\u548c\u89c6\u56fe\u53bb\u5b8c\u6210\u7528\u6237\u7684\u9700\u6c42\u3002\u6240\u4ee5\u5f53\u5355\u51fbWeb\u9875\u9762\u4e2d\u7684\u8d85\u94fe\u63a5\u548c\u53d1\u9001HTML\u8868\u5355\u65f6\uff0c\u63a7\u5236\u5668\u672c\u8eab\u4e0d\u8f93\u51fa\u4efb\u4f55\u4e1c\u897f\u548c\u505a\u4efb\u4f55\u5904\u7406\u3002\u5b83\u53ea\u662f\u63a5\u6536\u8bf7\u6c42\u5e76\u51b3\u5b9a\u8c03\u7528\u54ea\u4e2a\u6a21\u578b\u6784\u4ef6\u53bb\u5904\u7406\u8bf7\u6c42\uff0c\u7136\u540e\u518d\u786e\u5b9a\u7528\u54ea\u4e2a\u89c6\u56fe\u6765\u663e\u793a\u8fd4\u56de\u7684\u6570\u636e\u3002<\/p>\n<p><strong>MVC\u4f18\u70b9\uff1a<\/strong><\/p>\n<p>\u4f4e\u8026\u5408<\/p>\n<p>\u9ad8\u5ea6\u91cd\u7528\u6027<\/p>\n<p>\u9ad8\u6548\u90e8\u7f72\uff0c\u964d\u4f4e\u5f00\u53d1\u5468\u671f<\/p>\n<p>\u53ef\u7ef4\u62a4\u6027<\/p>\n<p>\u6709\u7406\u8f6f\u4ef6\u5de5\u7a0b\u5316\u7ba1\u7406<\/p>\n<p><strong>PHP\u4e2d\u6bd4\u8f83\u597d\u7684MVC\u6846\u67b6\uff1a<\/strong><\/p>\n<p>Zend framework PHP\u5b98\u65b9\u6846\u67b6<\/p>\n<p>ThinkPHP \u56fd\u4ea7\u6846\u67b6<\/p>\n<p>yii \u9ad8\u6548\u7684\u6b21\u8f7b\u91cf\u7ea7\u6846\u67b6<\/p>\n<p>\u2026\u2026\u2026\u2026<\/p>\n<p><strong>\u56fe\u7247\u670d\u52a1\u5668\u5206\u79bb<\/strong><\/p>\n<p>\u539f\u56e0\u5206\u6790\uff1a\u5bf9\u4e8e\u4e00\u4e2a\u975e\u89c6\u9891\u7c7b\u7684\u7f51\u7ad9\uff0c\u56fe\u7247\u4e00\u822c\u662f\u6700\u6d88\u8017\u8d44\u6e90\u7684\uff0c \u8fd9\u4e2a\u65f6\u5019\u5e94\u8be5\u8003\u8651\u56fe\u7247\u4e0e\u9875\u9762\u5206\u79bb\uff0c\u4e5f\u5c31\u662f\u72ec\u7acb\u7684\u56fe\u7247\u670d\u52a1\u5668.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.icocean.com\/blog\/wp-content\/uploads\/auto_save_image\/2011\/10\/0329593zn.jpg\" alt=\"LAMP\u7f51\u7ad9\u67b6\u6784\u65b9\u6848\u5206\u6790\" width=\"500\" height=\"445\" border=\"0\" \/><\/p>\n<p>\u4e0a\u9762\u662f\u7ecf\u5178\u7684LAMP\u67b6\u6784\u56fe\uff0c\u5728LAMP\u67b6\u6784\u4e2d\uff0c\u5f53\u6d41\u91cf\u5f88\u5927\u5230\u65f6\u5019\uff0capache\u670d\u52a1\u5668\u7684\u7f3a\u70b9\u5c31\u66b4\u9732\u51fa\u6765\uff0c<\/p>\n<p>\u53ef\u4ee5\u91c7\u7528nginx\u6765\u8d1f\u8f7d\u975ePHP\u7684Web\u8bf7\u6c42\uff0c\u4f7f\u7528nginx\u8fd9\u79cd\u9ad8\u6027\u80fd\u7684HTTP\u548c\u53cd\u5411\u4ee3\u7406\u670d\u52a1\u5668\u4f5c\u4e3a\u9759\u6001\u8d44\u6e90\u7684\u72ec\u7acb\u670d\u52a1\u5668\uff0c\u4fdd\u8bc1\u7cfb\u7edf\u7684\u6d88\u8017\u548c\u6267\u884c\u6548\u7387\u3002<\/p>\n<p><strong>\u7f13\u5b58\u6280\u672f<\/strong><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.icocean.com\/blog\/wp-content\/uploads\/auto_save_image\/2011\/10\/03300023H.png\" alt=\"image\" width=\"493\" height=\"418\" border=\"0\" \/><\/p>\n<p>LAMP\u7f13\u5b58\u56fe<\/p>\n<p>\u4ece\u56fe\u4e2d\u6211\u4eec\u53ef\u4ee5\u770b\u5230\u7f51\u7ad9\u7f13\u5b58\u4e3b\u8981\u5206\u4e3a\u4e94\u90e8\u5206\uff1a<\/p>\n<p>1.\u670d\u52a1\u5668\u7f13\u5b58\uff1a\u4e3b\u8981\u662f\u57fa\u4e8eweb\u53cd\u5411\u4ee3\u7406\u7684\u9759\u6001\u670d\u52a1\u5668nginx\u548csquid\uff0c\u8fd8\u6709apache2\u7684mod_proxy\u548cmod_cache\u6a21\u5757<\/p>\n<p>2.\u6d4f\u89c8\u5668\u7f13\u5b58\uff1a\u5305\u62ec\u9875\u9762html\u7f13\u5b58\u548c\u56fe\u7247js\uff0ccss\u7b49\u8d44\u6e90\u7684\u7f13\u5b58<\/p>\n<p>3.PHP\u7f13\u5b58\uff1a\u6709\u5f88\u591a\u514d\u8d39\u7684PHP\u7f13\u51b2\u52a0\u901f\u5de5\u5177\uff0c\u5982apc \uff0ceaccerlertor\u7b49<\/p>\n<p>4.\u5185\u5b58\u7f13\u5b58\uff1a\u4e3b\u8981\u662f\u91c7\u7528memcached\u8fd9\u79cd\u5206\u5e03\u5f0f\u7f13\u5b58\u673a\u5236<\/p>\n<p>5.\u6570\u636e\u5e93\u7f13\u5b58\uff1a\u901a\u8fc7\u914d\u7f6e\u6570\u636e\u5e93\u7f13\u5b58\uff0c\u4ee5\u53ca\u6570\u636e\u5b58\u50a8\u8fc7\u7a0b\uff0c\u8fde\u63a5\u6c60\u6280\u672f\u7b49<\/p>\n<p>\u7f13\u5b58\u9ec4\u91d1\u539f\u5219\uff1a<strong>\u8ba9\u6570\u636e\u66f4\u9760\u8fd1 CPU<\/strong>\u3002<\/p>\n<p>CPU&#8211;&gt;CPU \u4e00\u7ea7\u7f13\u5b58&#8211;&gt;\u4e8c\u7ea7\u7f13\u5b58&#8211;&gt;\u5185\u5b58&#8211;&gt;\u786c\u76d8&#8211;&gt;LAN&#8211;&gt;WAN<\/p>\n<p><strong>\u6570\u636e\u5e93\u96c6\u7fa4\u548c\u5e93\u8868\u6563\u5217\u7b49\u7b49<\/strong><\/p>\n<p>\u8fd9\u70b9\u672c\u4eba\u6ca1\u6709\u6d89\u730e\u53ef\u4ee5\u53c2\u8003\u4f18\u9177\u7f51\u67b6\u6784\u4e2d\u7684\u6570\u636e\u5e93\u5904\u7406\u65b9\u6cd5\uff1a<\/p>\n<p><a href=\"http:\/\/www.chinaz.com\/web\/2011\/1026\/215886.shtml\" target=\"_blank\">http:\/\/www.chinaz.com\/web\/2011\/1026\/215886.shtml<\/a><\/p>\n<p><strong>\u8d1f\u8f7d\u5747\u8861<\/strong><\/p>\n<p>\u8d1f\u8f7d\u5747\u8861\u5c06\u662f\u5927\u578b\u7f51\u7ad9\u89e3\u51b3\u9ad8\u8d1f\u8377\u8bbf\u95ee\u548c\u5927\u91cf\u5e76\u53d1\u8bf7\u6c42\u91c7\u7528\u7684\u7ec8\u6781\u89e3\u51b3\u529e\u6cd5\u3002<\/p>\n<p><strong>\u4f18\u70b9<\/strong><\/p>\n<p>\uff081\uff09\u89e3\u51b3\u7f51\u7edc\u62e5\u585e\u95ee\u9898\uff0c\u5c31\u8fd1\u63d0\u4f9b\u670d\u52a1\uff0c\u5b9e\u73b0\u5730\u7406\u4f4d\u7f6e\u65e0\u5173\u6027\uff1b<\/p>\n<p>\uff082\uff09\u4e3a\u7528\u6237\u63d0\u4f9b\u66f4\u597d\u7684\u8bbf\u95ee\u8d28\u91cf\uff1b<\/p>\n<p>\uff083\uff09\u63d0\u9ad8\u670d\u52a1\u5668\u54cd\u5e94\u901f\u5ea6\uff1b<\/p>\n<p>\uff084\uff09\u63d0\u9ad8\u670d\u52a1\u5668\u53ca\u5176\u4ed6\u8d44\u6e90\u7684\u5229\u7528\u6548\u7387\u3002<\/p>\n<p><strong>PHP\u4e2dweb server\u89e3\u51b3\u65b9\u6848<\/strong><\/p>\n<p>\u5bf9\u4e8ePHP\u7684webserver\u7684\u8d1f\u8f7d\u5747\u8861\uff0c<\/p>\n<p><strong>apache\u7684\u5747\u8861\u7b56\u7565<\/strong><\/p>\n<p>ProxyPass \u6307\u4ee4<\/p>\n<p>\u8bf4\u660e<\/p>\n<p>\u5c06\u4e00\u4e2a\u8fdc\u7aef\u670d\u52a1\u5668\u6620\u5c04\u5230\u672c\u5730\u670d\u52a1\u5668\u7684URL\u7a7a\u95f4\u4e2d<\/p>\n<p>\u8bed\u6cd5<\/p>\n<p>ProxyPass [path] ! |url [key=value key=value &#8230;]]<\/p>\n<p>\u4f5c\u7528\u57df<\/p>\n<p>server config, virtual host,directory<\/p>\n<p>\u6a21\u5757<\/p>\n<p>mod_proxy<\/p>\n<p>\u8be5\u6307\u4ee4\u5141\u8bb8\u4f60\u5c06\u4e00\u4e2a\u8fdc\u7aef\u670d\u52a1\u5668\u6620\u5c04\u5230\u672c\u5730\u670d\u52a1\u5668\u7684URL\u7a7a\u95f4\u4e2d\uff0c\u6b64\u65f6\u672c\u5730\u670d\u52a1\u5668\u5e76\u4e0d\u5145\u5f53\u4ee3\u7406\u89d2\u8272\uff0c\u800c\u662f\u5145\u5f53\u8fdc\u7a0b\u670d\u52a1\u5668\u7684\u4e00\u4e2a\u955c\u50cf\u3002path\u662f\u4e00\u4e2a\u672c\u5730\u865a\u62df\u8def\u5f84\u540d\uff0curl\u662f\u4e00\u4e2a\u6307\u5411\u8fdc\u7a0b\u670d\u52a1\u5668\u7684\u90e8\u5206URL\uff0c\u5e76\u4e14\u4e0d\u5141\u8bb8\u5305\u542b\u67e5\u8be2\u5b57\u7b26\u4e32\u3002<\/p>\n<p>\u5f53\u4f7f\u7528ProxyPass\u6307\u4ee4\u65f6\uff0cProxyRequests\u6307\u4ee4\u901a\u5e38\u5e94\u5f53\u88ab\u8bbe\u4e3a off\u3002<\/p>\n<p>\u5047\u8bbe\u672c\u5730\u670d\u52a1\u5668\u5730\u5740\u662f\uff1ahttp:\/\/example.com\/\uff0c\u90a3\u4e48\uff0c<\/p>\n<p>ProxyPass \/mirror\/foo\/ http:\/\/backend.example.com\/<\/p>\n<p>\u5c06\u4f1a\u5bfc\u81f4\u5bf9http:\/\/example.com\/mirror\/foo\/bar\u7684\u672c\u5730\u8bf7\u6c42\u5c06\u4f1a\u5728\u5185\u90e8\u8f6c\u6362\u4e3a\u4e00\u4e2a\u4ee3\u7406\u8bf7\u6c42\uff1ahttp:\/\/backend.example.com\/bar\u3002<\/p>\n<p>\u66f4\u8be6\u7ec6\u7684\u8bf4\u660e\u53ef\u4ee5\u53c2\u770b\uff1a<a href=\"http:\/\/httpd.apache.org\/docs\/2.2\/mod\/mod_proxy.html\" target=\"_blank\">http:\/\/httpd.apache.org\/docs\/2.2\/mod\/mod_proxy.html<\/a><\/p>\n<p>apache\u7684\u4e09\u79cd\u5747\u8861\u8d1f\u8f7d\u7b56\u7565\uff1a<a href=\"http:\/\/s456123123b.blog.163.com\/blog\/static\/5632332220101080474642\/\" target=\"_blank\">http:\/\/s456123123b.blog.163.com\/blog\/static\/5632332220101080474642\/<\/a><\/p>\n<p><strong>nginx\u7684\u8d1f\u8f7d\u5747\u8861<\/strong><\/p>\n<p>HTTP Upstream \u6a21\u5757\uff0c\u8be5\u6a21\u5757\u4e3a\u540e\u7aef\u670d\u52a1\u5668\u63d0\u4f9b\u7b80\u5355\u7684\u8d1f\u8f7d\u5747\u8861\uff08\u8f6e\u5faa\u8c03\u5ea6\u548c\u5ba2\u6237\u7aef IP\uff09\u3002<\/p>\n<p>\u793a\u4f8b\uff1a<\/p>\n<p>upstream backend {<\/p>\n<p>server backend1.example.com weight=5;<\/p>\n<p>server backend2.example.com:8080;<\/p>\n<p>server unix:\/tmp\/backend3;<\/p>\n<p>} server {<\/p>\n<p>location \/ {<\/p>\n<p>proxy_pass http:\/\/backend;<\/p>\n<p>}<\/p>\n<p>}<\/p>\n<p>\u5b98\u65b9\u8d44\u6599\uff1a<a href=\"http:\/\/wiki.nginx.org\/NginxChsHttpUpstreamModule\" target=\"_blank\">http:\/\/wiki.nginx.org\/NginxChsHttpUpstreamModule<\/a><\/p>\n<p><strong>\u524d\u7aef\u9875\u9762\u4f18\u5316<\/strong><\/p>\n<p>\u524d\u7aef\u4f18\u5316\u539f\u5219<\/p>\n<p>\u00b7 \u5e26\u5bbd<\/p>\n<p>o \u4f7f\u7528CDN<\/p>\n<p>o \u538b\u7f29js\u3001css\uff0c\u56fe\u7247\u4f18\u5316<\/p>\n<p>\u00b7 HTTP\u4f18\u5316<\/p>\n<p>o \u51cf\u5c11\u8f6c\u5411<\/p>\n<p>o \u51cf\u5c11\u8bf7\u6c42\u6570<\/p>\n<p>o \u7f13\u5b58<\/p>\n<p>o \u5c3d\u65e9Flush<\/p>\n<p>o \u4f7f\u7528gzip<\/p>\n<p>o \u51cf\u5c11cookie<\/p>\n<p>o \u4f7f\u7528GET<\/p>\n<p>\u00b7 DNS\u4f18\u5316<\/p>\n<p>o \u51cf\u5c11\u57df\u540d\u89e3\u6790\u65f6\u95f4<\/p>\n<p>o \u589e\u591a\u57df\u540d\u63d0\u9ad8\u5e76\u53d1<\/p>\n<p>\u00b7 JavaScript<\/p>\n<p>o \u653e\u9875\u9762\u5e95\u90e8<\/p>\n<p>o defer\/async<\/p>\n<p>\u00b7 CSS<\/p>\n<p>o \u653e\u9875\u9762\u5934\u90e8<\/p>\n<p>o \u907f\u514d@import<\/p>\n<p>\u00b7 \u5176\u5b83<\/p>\n<p>o \u9884\u52a0\u8f7d<\/p>\n<p><strong>\u603b\u7ed3\uff1a<\/strong><\/p>\n<p>\u524d\u7aef\u4f18\u5316&#8212;-HTML\u9759\u6001\u5316&#8212;&#8211;PHP\u6846\u67b6\uff08MVC\u601d\u60f3\uff09&#8212;-\u6570\u636e\u5e93\u96c6\u7fa4\u548c\u5e93\u8868&#8212;&#8212;\u56fe\u7247\u670d\u52a1\u5668\u5206\u79bb&#8212;-\u8d1f\u8f7d\u5747\u8861<\/p>\n<p>\u5916\u52a0\u4e00\u4e2a\uff1a\u4e00\u4e2a\u8d2f\u7a7f\u59cb\u7ec8\u7684\u7f13\u5b58\u6280\u672f\uff0c\u65b9\u6cd5\u90fd\u662f\u57fa\u7840\u65b9\u6cd5\uff0c\u4f46\u662f\u5982\u4f55\u8ba9\u4ed6\u4eec\u8fbe\u5230\u9ad8\u805a\u5408\u4f4e\u8026\u5408\u7684\u72b6\u6001\u5c31\u6709\u4e0d\u7b80\u5355\u4e86\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u524d\u8a00\uff1a \u5bf9\u4e8e\u6784\u67b6\u9ad8\u6027\u80fd\u7684web\u7f51\u7ad9\u5927\u5bb6\u90fd\u5f88\u611f\u5174\u8da3\uff0c\u672c\u6587\u4ece\u51e0\u70b9\u7c97\u8c08\u9ad8\u6027\u80fdweb\u7f51\u7ad9\u9700\u8981\u8003\u8651\u7684\u95ee\u9898\u3002 HTML\u9759\u6001 <a href='https:\/\/www.icocean.com\/blog\/?p=3089' class='excerpt-more'>[&#8230;]<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4],"tags":[],"class_list":["post-3089","post","type-post","status-publish","format-standard","hentry","category-4","category-4-id","post-seq-1","post-parity-odd","meta-position-corners","fix"],"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/www.icocean.com\/blog\/index.php?rest_route=\/wp\/v2\/posts\/3089","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.icocean.com\/blog\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.icocean.com\/blog\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.icocean.com\/blog\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.icocean.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=3089"}],"version-history":[{"count":1,"href":"https:\/\/www.icocean.com\/blog\/index.php?rest_route=\/wp\/v2\/posts\/3089\/revisions"}],"predecessor-version":[{"id":3092,"href":"https:\/\/www.icocean.com\/blog\/index.php?rest_route=\/wp\/v2\/posts\/3089\/revisions\/3092"}],"wp:attachment":[{"href":"https:\/\/www.icocean.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=3089"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.icocean.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=3089"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.icocean.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=3089"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}