{"id":563,"date":"2014-01-06T23:59:51","date_gmt":"2014-01-06T15:59:51","guid":{"rendered":"http:\/\/www.361.xxx\/?p=563"},"modified":"2014-01-06T23:59:51","modified_gmt":"2014-01-06T15:59:51","slug":"%e7%ae%80%e6%98%93nginx%e9%85%8d%e7%bd%ae%e5%8f%8d%e5%90%91%e4%bb%a3%e7%90%86","status":"publish","type":"post","link":"http:\/\/www.cyups.com\/?p=563","title":{"rendered":"\u7b80\u6613nginx\u914d\u7f6e\u53cd\u5411\u4ee3\u7406"},"content":{"rendered":"<p>\u6700\u8fd1\u51e0\u5468\uff0c\u5c0f\u7ad9\u300c\u6709\u70b9\u786c\u300d\u6240\u5728\u7684VPS\u7ebf\u8def\u8d85\u7ea7\u4e0d\u7a33\u5b9a\uff0c\u5bfc\u81f4\u5e7f\u5927\u5c4c\u4e1d\u8bbf\u95ee\u8d77\u6765\u975e\u5e38\u5403\u529b\u3002<br \/>\n\u5c3d\u7ba1\u6b64\u524d\u6211\u5df2\u4f7f\u7528MiniCDN\u505a\u4e86\u9759\u6001\u6587\u4ef6\u7684\u5206\u53d1\u7f13\u5b58\uff0c\u4f46\u662f\u67d0\u4e9b\u65f6\u5019\u6253\u5f00\u9875\u9762\u4f9d\u7136\u6162\u5982\u725b~<br \/>\n\u60f3\u5230\u4e3b\u7ad9\u5b85\u7537\u7684VPS\u5728\u65b0\u52a0\u5761\uff0c\u8d70PCCW\u7ebf\u8def\uff0c\u55ef\u2026\u2026\u662f\u4e0d\u662f\u53ef\u4ee5\u52a0\u4e2a\u901f\u5462\uff1f<br \/>\n\u8d77\u521d\u60f3\u5230\u7528squid\uff0c\u4f46\u662f\u53ef\u601c\u6211\u7684VPS\u53ea\u6709128M\u5185\u5b58\uff0c\u6302\u4e2asquid\u505a\u4e2a\u4eba\u4ee3\u7406\u8fd8\u884c\uff0cCDN\u5c31\u7b97\u4e86~<br \/>\n\u6700\u540e\u60f3\u5230\u7528nginx\u505a\u53cd\u4ee3\u5427\u2026\u2026\u4e8e\u662f\u5c31\u6539\u914d\u7f6e\u6587\u4ef6<\/p>\n<div id=\"highlighter_475017\">\n<div>\n<div><a title=\"view source\" href=\"http:\/\/zhainan.org\/post-1722.html#viewSource\" target=\"_blank\"  rel=\"nofollow\" >view source<\/a><\/p>\n<div><\/div>\n<p><a title=\"print\" href=\"http:\/\/zhainan.org\/post-1722.html#printSource\" target=\"_blank\"  rel=\"nofollow\" >print<\/a><a title=\"?\" href=\"http:\/\/zhainan.org\/post-1722.html#about\" target=\"_blank\"  rel=\"nofollow\" >?<\/a><\/div>\n<\/div>\n<div>\n<div>\n<table>\n<tbody>\n<tr>\n<td><code>server {<\/code><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<div>\n<table>\n<tbody>\n<tr>\n<td><code>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0<\/code><code>listen\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 80;<\/code><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<div>\n<table>\n<tbody>\n<tr>\n<td><code>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0<\/code><code>server_name\u00a0 youdian.<\/code><code>in<\/code><code>;<\/code><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<div>\n<table>\n<tbody>\n<tr>\n<td><code>location \/ {<\/code><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<div>\n<table>\n<tbody>\n<tr>\n<td><code>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0<\/code><code>\/\/\u540e\u7aef\u670d\u52a1\u5668\uff08\u6211\u628a@\u89e3\u6790\u5230\u524dnginx\uff0cwww\u89e3\u6790\u5230\u540e\u7aef\uff09<\/code><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<div>\n<table>\n<tbody>\n<tr>\n<td><code>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0<\/code><code>proxy_pass\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 http:\/\/www.youdian.<\/code><code>in<\/code><code>;<\/code><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<div>\n<table>\n<tbody>\n<tr>\n<td><code>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0<\/code><code>\/\/\u5173\u95ed\u540e\u7aef\u8fd4\u56de\u7684header\u4fee\u6539<\/code><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<div>\n<table>\n<tbody>\n<tr>\n<td><code>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0<\/code><code>proxy_redirect\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 off; <\/code><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<div>\n<table>\n<tbody>\n<tr>\n<td><code>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0<\/code><code>\/\/\u4fee\u6539\u53d1\u9001\u5230\u540e\u7aef\u7684header\u7684host<\/code><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<div>\n<table>\n<tbody>\n<tr>\n<td><code>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0<\/code><code>proxy_set_header\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 Host $host;<\/code><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<div>\n<table>\n<tbody>\n<tr>\n<td><code>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0<\/code><code>\/\/\u8bbe\u7f6e\u771f\u5b9eip <\/code><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<div>\n<table>\n<tbody>\n<tr>\n<td><code>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0<\/code><code>proxy_set_header\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 X-Real-IP $remote_addr; <\/code><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<div>\n<table>\n<tbody>\n<tr>\n<td><code>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0<\/code><code>proxy_set_header\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 X-Forwarded-For $proxy_add_x_forwarded_for;<\/code><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<div>\n<table>\n<tbody>\n<tr>\n<td><code>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0<\/code><code>}<\/code><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<div>\n<table>\n<tbody>\n<tr>\n<td><code>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0<\/code><code>}<\/code><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<\/div>\n<\/div>\n<p>\u4ee5\u4e0a\u53ea\u662f\u7b80\u5355\u7684\u5728nginx\u914d\u7f6e\u53cd\u5411\u4ee3\u7406\uff0c\u8fd8\u6709\u5176\u4ed6\u7684\u4e00\u4e9b\u53c2\u6570\u6ca1\u6709\u7528\u5230\u3002\u5c31\u5148\u8fd9\u4e48\u7740\u5427~\u559c\u6b22\u6298\u817e\u7684\u670b\u53cb\u81ea\u5df1\u53bb\u641c\u641c\uff0c\u8fd9\u91cc\u6211\u5c31\u4e0d\u5217\u4e86\u3002\u61d2\u4e86\u61d2\u4e86\u2026\u2026<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u6700\u8fd1\u51e0\u5468\uff0c\u5c0f\u7ad9\u300c\u6709\u70b9\u786c\u300d\u6240\u5728\u7684VPS\u7ebf\u8def\u8d85\u7ea7\u4e0d\u7a33\u5b9a\uff0c\u5bfc\u81f4\u5e7f\u5927\u5c4c\u4e1d\u8bbf\u95ee\u8d77\u6765\u975e\u5e38\u5403\u529b\u3002 \u5c3d\u7ba1\u6b64\u524d\u6211\u5df2\u4f7f\u7528MiniCDN\u505a\u4e86\u9759\u6001\u6587\u4ef6\u7684\u5206 &#8230;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"emotion":"","emotion_color":"","title_style":"","license":"","footnotes":""},"categories":[14],"tags":[57,174,212,338,339,436],"class_list":["post-563","post","type-post","status-publish","format-standard","hentry","category-pcsoft","tag-cdn","tag-ngixproxy","tag-squid-vps","tag-338","tag-339","tag-436"],"_links":{"self":[{"href":"http:\/\/www.cyups.com\/index.php?rest_route=\/wp\/v2\/posts\/563","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/www.cyups.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.cyups.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.cyups.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/www.cyups.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=563"}],"version-history":[{"count":0,"href":"http:\/\/www.cyups.com\/index.php?rest_route=\/wp\/v2\/posts\/563\/revisions"}],"wp:attachment":[{"href":"http:\/\/www.cyups.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=563"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.cyups.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=563"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.cyups.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=563"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}