<br />
<b>Warning</b>:  Undefined array key "HTTP_ACCEPT_LANGUAGE" in <b>/www/wwwroot/01xj.net/wp-content/plugins/wp-ue/main.php</b> on line <b>13</b><br />
{"id":63,"date":"2011-09-13T13:34:32","date_gmt":"2011-09-13T13:34:32","guid":{"rendered":"http:\/\/www.01xj.net\/0\/?p=63"},"modified":"2011-09-13T14:14:19","modified_gmt":"2011-09-13T14:14:19","slug":"windows%e4%b8%8bnginxphp5fastcgi%e5%ae%89%e8%a3%85%e9%85%8d%e7%bd%ae%e8%af%a6%e8%a7%a3","status":"publish","type":"post","link":"https:\/\/www.01xj.net\/?p=63","title":{"rendered":"\u7528Nginx\u505a\u9759\u6001\u6587\u4ef6\u7684CDN"},"content":{"rendered":"<p id=\"ctrlfssummary\">\u6838\u5fc3\u63d0\u793a\uff1a\u9274\u4e8e\u76d1\u7ba1\u73af\u5883\u548c\u7f51\u7ad9\u901f\u5ea6\u4e4b\u95f4\u7684\u77db\u76fe\uff0c\u76ee\u524d\u7684\u7f51\u7edc\u67b6\u6784\u65b9\u5f0f\u5982\u4e0b\uff1a1\u3001web\u52a8\u6001\u9875\u9762(\u542b\u6570\u636e\u5e93)\u67b6\u8bbe\u5728\u4f4d\u4e8e\u7f8e\u56fd\u897f\u6d77\u5cb8\u7684\u6570\u636e\u4e2d\u5fc3\uff1b2\u3001\u9759\u6001\u6587\u4ef6\uff0c\u4f8b\u5982css\u3001js\u3001exe\u3001\u56fe\u7247\u5b58\u653e\u5728\u56fd\u5185\u51e0\u53f0windows\u670d\u52a1\u5668\u4e0a\u3002<\/p>\n<p><strong>\u9274\u4e8e\u76d1\u7ba1\u73af\u5883\u548c\u7f51\u7ad9\u901f\u5ea6\u4e4b\u95f4\u7684\u77db\u76fe\uff0c\u76ee\u524d\u7684\u7f51\u7edc\u67b6\u6784\u65b9\u5f0f\u5982\u4e0b\uff1a<\/strong><\/p>\n<p>1\u3001web\u52a8\u6001\u9875\u9762(\u542b\u6570\u636e\u5e93)\u67b6\u8bbe\u5728\u4f4d\u4e8e\u7f8e\u56fd\u897f\u6d77\u5cb8\u7684\u6570\u636e\u4e2d\u5fc3\uff1b<\/p>\n<p>2\u3001\u9759\u6001\u6587\u4ef6\uff0c\u4f8b\u5982css\u3001js\u3001exe\u3001\u56fe\u7247\u5b58\u653e\u5728\u56fd\u5185\u51e0\u53f0windows\u670d\u52a1\u5668\u4e0a\u3002<\/p>\n<p>\u5982\u679c\u4f60\u7684\u7f51\u7ad9\u662f\u5546\u7528\u3001\u76c8\u5229\u6027\u7684\u7f51\u7ad9\uff0c\u800c\u6ca1\u6709\u6280\u672f\u80fd\u529b\u642d\u5efaCDN\uff0c\u8bf7\u4f7f\u7528\u7b2c\u4e09\u65b9CDN\u670d\u52a1\u3002<\/p>\n<p><strong>\u5b58\u5728\u7684\u95ee\u9898\u6709\uff1a<\/strong><\/p>\n<p>1\u3001\u9759\u6001\u6587\u4ef6\u540c\u6b65\u95ee\u9898\uff1b<\/p>\n<p>2\u3001\u7f13\u5b58\u5237\u65b0\u95ee\u9898\u3002<br \/>\n\u7b2c\u4e00\u4e2a\u95ee\u9898\u4f7f\u7528nginx\u5f97\u5230\u89e3\u51b3\u3002\u4f7f\u7528proxy_store\u529f\u80fd\uff0c\u5728\u6587\u4ef6\u4e0d\u5b58\u5728\u7684\u65f6\u5019\u8bf7\u6c42\u6e90\u670d\u52a1\u5668\uff0c\u5e76\u4fdd\u5b58\u3002<\/p>\n<p>\u6587\u4ef6\u5b58\u5728\u65f6\u76f4\u63a5\u8bfb\u53d6\u672c\u673a\u6587\u4ef6\u3002<\/p>\n<p>squid\u7b49\u65b9\u6848\u56e0\u4e3a\u518d\u5b66\u4e60\u4e00\u4e2a\u65b0\u5de5\u5177\u9700\u8981\u6210\u672c\uff1b\u800cnginx\u7684\u5b9e\u9645\u4f7f\u7528\u60c5\u51b5\u5e76\u4e0d\u900a\u8272\u4e8esquid\u7b49\u8f6f\u4ef6\u3002\u6240\u4ee5\u4e0d\u4e88\u8003\u8651\u3002\u8fd9\u5c31\u662f\u6240\u8c13\u8001\u5927\u62cd\u8111\u888b\u51b3\u5b9a\u65b9\u6848\u5427\u3002<\/p>\n<p>\u7b2c\u4e8c\u4e2a\u95ee\u9898\uff0c\u53c2\u8003\u7b2c\u56db\u5c4aD2\u4e0a\u53e3\u7891\u7f51\u5206\u4eab\u7684\u7ecf\u9a8c\uff1aCDN\u4e0a\u9759\u6001\u6587\u4ef6\u4e0d\u63d0\u4f9b\u5220\u9664\u529f\u80fd\u3002\u5176\u5b9e\u4e5f\u672a\u5c1d\u4e0d\u53ef\u3002\u5f53\u7136\u4e5f\u53ef\u4ee5\u4f7f\u7528\u76f8\u5e94nginx\u6269\u5c55\u63a5\u53e3\u751a\u81f3php\u6587\u4ef6\u6765\u6e05\u9664\u7f13\u5b58\uff0c\u4e5f\u4e0d\u662f\u5f88\u590d\u6742\u3002<\/p>\n<p>\u5b89\u88c5<\/p>\n<p>\u5982\u679c\u4f60\u7684\u7cfb\u7edf\u662flinux\u7684\uff0c\u53ef\u5ffd\u7565\u7b2c\u4e00\u6b65\uff0c\u770b\u7b2c\u4e8c\u6b65\uff1a\u914d\u7f6e\u65b9\u5f0f<\/p>\n<p><strong>1\u3001\u5b89\u88c5Nginx<\/strong><\/p>\n<p>windows\u5728\u751f\u4ea7\u73af\u5883\u5b89\u88c5nginx\u6700\u597d\u4f7f\u7528\u670d\u52a1\u7684\u65b9\u5f0f\u3002\u5982\u679c\u6839\u636e\u7f51\u4e0a\u63d0\u4f9b\u7684instsrv.exe\u6ce8\u518c\u670d\u52a1\u65b9\u6848\uff0c\u5177\u6709\u82e5\u5e72\u7f3a\u9677\u3002\u6bd4\u5982 nginx.exe\u4f5c\u4e3a\u4e3b\u8fdb\u7a0b\u542f\u52a8\u53e6\u4e00\u4e2a\u8fdb\u7a0b\uff0c\u800cinstsrv.exe\u53ea\u80fd\u76d1\u63a7\u4e00\u4e2a\u8fdb\u7a0b\u3002\u8fd9\u91cc\u63a8\u8350\u4fc4\u7f57\u65af\u4eba\u5199\u7684\u4e00\u6b3e\u5c0f\u5de5\u5177NG_SRVINST<\/p>\n<p>\u5730\u5740\uff1ahttp:\/\/ng_srvinst.att.kiev.ua\/<\/p>\n<p>\u4f7f\u7528\u5f88\u7b80\u5355\uff0c\u89e3\u538b\u5230\u4efb\u610f\u6587\u4ef6\u5939\u540e\uff0c\u4fee\u6539ng_srv.xml\u5185Nginx\u7684\u8def\u5f84\uff0c\u6bd4\u5982<\/p>\n<p>&nbsp;<\/p>\n<table width=\"95%\" border=\"0\" cellspacing=\"0\" cellpadding=\"6\" align=\"center\">\n<tbody>\n<tr>\n<td bgcolor=\"#ddedfb\"><strong>XML\/HTML\u4ee3\u7801<\/strong><\/p>\n<p>01.&lt;service&gt;<br \/>\n02. &lt;id&gt;nginx&lt;\/id&gt;<br \/>\n03.\u00a0 &lt;name&gt;nginx&lt;\/name&gt;<br \/>\n04.\u00a0 &lt;description&gt;nginx&lt;\/description&gt;<br \/>\n05.\u00a0 &lt;executable&gt;E:\\nginx\\nginx.exe&lt;\/executable&gt;<br \/>\n06.\u00a0 &lt;logpath&gt;E:\\wwwroot\\logfiles\\&lt;\/logpath&gt;<br \/>\n07.\u00a0 &lt;logmode&gt;roll&lt;\/logmode&gt;<br \/>\n08.\u00a0 &lt;depend&gt;&lt;\/depend&gt;<br \/>\n09.\u00a0 &lt;startargument&gt;-p E:\\nginx&lt;\/startargument&gt;<br \/>\n10.\u00a0 &lt;stopargument&gt;-p E:\\nginx -s stop&lt;\/stopargument&gt;<br \/>\n11.&lt;\/service&gt;<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>\u7136\u540eng_srv.exe install\u5c31\u5b89\u88c5\u597d\u4e86\u3002<\/p>\n<p><strong>2\u3001\u914d\u7f6e\u65b9\u5f0fproxy<\/strong><\/p>\n<p>\u9996\u5148\u4fee\u6539HOSTS\u5185\u7684\u57df\u540d\u6307\u5411\u6e90\u670d\u52a1\u5668\u7684ip\uff0c\u7136\u540e\uff0c\u89c1\u914d\u7f6e\u6587\u4ef6\u3002\u628awucha.sg\u66ff\u6362\u4e3a\u4f60\u7684\u57df\u540d\u5373\u53ef\u3002\uff08\u6216\u8005\u53ea\u4fee\u6539proxy_pass http:\/\/\u6e90\u670d\u52a1\u5668\u7684ip; \u4e5f\u662f\u53ef\u4ee5\u7684\uff09<\/p>\n<p>&nbsp;<\/p>\n<table width=\"95%\" border=\"0\" cellspacing=\"0\" cellpadding=\"6\" align=\"center\">\n<tbody>\n<tr>\n<td bgcolor=\"#ddedfb\"><span style=\"color: #000000;\"><strong>JavaScript\u4ee3\u7801<\/strong><\/span><\/p>\n<p>01.server {<br \/>\n02. server_name\u00a0 wucha.sg;<br \/>\n03. root E:\/wwwroot;<br \/>\n04. set $index &#8216;index.html&#8217;;<br \/>\n05. set $store_file $request_filename;<br \/>\n06. if ($uri ~ \/$ ){<br \/>\n07.\u00a0 set $store_file $request_filename$index;<br \/>\n08.\u00a0 rewrite (.*) $1index.html last;<br \/>\n09. }<br \/>\n10. location \/ {<br \/>\n11.\u00a0 root &#8220;E:\/wwwroot&#8221;;<br \/>\n12.\u00a0 index index.html;<br \/>\n13.\u00a0 proxy_store on;<br \/>\n14.\u00a0 proxy_temp_path &#8220;E:\/wwwroot&#8221;;<br \/>\n15.\u00a0 proxy_set_header Host wucha.sg;<br \/>\n16.\u00a0 proxy_set_header X-Real-IP $remote_addr;<br \/>\n17.\u00a0 if ( !-e $request_filename ) {<br \/>\n18.\u00a0\u00a0 proxy_pass http:\/\/wucha.sg;<br \/>\n19.\u00a0 }<br \/>\n20. }<br \/>\n21.}<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>\u542f\u52a8nginx\u670d\u52a1\uff0c\u8bd5\u8bd5\u8bbf\u95ee\u4e00\u4e2a\u6587\u4ef6\uff0c\u7136\u540e\u770b\u770bproxy_temp_path\u4e0b\u6709\u6ca1\u6709\u751f\u6210\u6587\u4ef6\u3002\u8fd9\u4e00\u6b65\u6211\u9047\u4e0a\u4e86\u70b9\u95ee\u9898\uff0c\u5c31\u662f\u6d4b\u8bd5txt\u6587\u4ef6\u6b7b\u6d3b\u4e0d\u751f\u6210\u3002\u6700\u540e\u8bbf\u95ee\u4e00\u4e2a\u5927\u4e8e70KB\u7684js\u751f\u6210\u4e86\uff0c\u518d\u8bbf\u95eetxt\u4e5f\u751f\u6210\u4e86\u3002<\/p>\n<p>\u8981\u6ce8\u610f\u7684\u662fnginx\u670d\u52a1\u7684\u6743\u9650\u8981\u6709\u8bfb\u5199\u4e34\u65f6\u6587\u4ef6\u5939\u7684\u6743\u9650\uff0c\u8fd8\u6709root\u548cproxy_temp_path\u6700\u597d\u5728\u540c\u4e00\u4e2a\u6587\u4ef6\u5939\u4e0b\uff08\u672a\u8003\u8bc1\uff0c\u4f46\u662f\u4f4d\u4e8e\u4e0d\u540c\u5206\u533a\u4f1a\u5bfc\u81f4\u9519\u8bef\u3002\uff09<\/p>\n<p>\u5982\u679c\u4f60\u770b\u5230\u6587\u4ef6\u5939\u5185\u4e00\u4e32\u6570\u5b57\uff0c\u5e76\u4e14\u6587\u4ef6\u5c3a\u5bf8\u5728\u4e0d\u65ad\u5728\u589e\u957f\uff0c\u90a3\u662fnginx\u5728\u4e0b\u8f7d\u6587\u4ef6\u65f6\u751f\u6210\u7684\u4e34\u65f6\u6587\u4ef6\u3002<\/p>\n<p>\u5927\u529f\u544a\u6210\uff0c\u53ef\u4ee5\u7528dnspod\u4e4b\u7c7b\u7684\u670d\u52a1\u6765\u505a\u7b80\u5355cdn\u3002\u8981\u53d1\u5e03\u6587\u4ef6\uff0c\u53ea\u9700\u4e0a\u4f20\u5230\u6e90\u670d\u52a1\u5668\uff0c\u5373\u80fd\u5728\u6240\u6709\u505a\u4e86\u914d\u7f6e\u7684\u670d\u52a1\u5668\u4e0a\u8bbf\u95ee\u3002<\/p>\n<p>\u672c\u6587\u91c7\u7528Creative Commons\u534f\u8bae\uff0c\u590d\u5236\u672c\u6587\u9700\u9075\u5b88\u4e09\u70b9\uff1a1\u3001\u4fdd\u7559\u7f72\u540d\uff08\u94fe\u63a5\uff09\uff1b2\u3001\u975e\u5546\u4e1a\u6027\u4f7f\u7528\uff1b3\u3001\u518d\u6b21\u521b\u4f5c\u7684\u4f5c\u54c1\u5fc5\u987b\u4ee5\u76f8\u540c\u7684\u8bb8\u53ef\u534f\u8bae\u53d1\u5e03\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u6838\u5fc3\u63d0\u793a\uff1a\u9274\u4e8e\u76d1\u7ba1\u73af\u5883\u548c\u7f51\u7ad9\u901f\u5ea6\u4e4b\u95f4\u7684\u77db\u76fe\uff0c\u76ee\u524d\u7684\u7f51\u7edc\u67b6\u6784\u65b9\u5f0f\u5982\u4e0b\uff1a&#46;&#46;&#46;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4,3],"tags":[],"class_list":["post-63","post","type-post","status-publish","format-standard","hentry","category-web","category-3"],"_links":{"self":[{"href":"https:\/\/www.01xj.net\/index.php?rest_route=\/wp\/v2\/posts\/63","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.01xj.net\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.01xj.net\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.01xj.net\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.01xj.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=63"}],"version-history":[{"count":4,"href":"https:\/\/www.01xj.net\/index.php?rest_route=\/wp\/v2\/posts\/63\/revisions"}],"predecessor-version":[{"id":65,"href":"https:\/\/www.01xj.net\/index.php?rest_route=\/wp\/v2\/posts\/63\/revisions\/65"}],"wp:attachment":[{"href":"https:\/\/www.01xj.net\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=63"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.01xj.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=63"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.01xj.net\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=63"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}