{"id":34299,"date":"2023-05-16T05:08:25","date_gmt":"2023-05-08T12:33:41","guid":{"rendered":"https:\/\/www.silicloud.com\/zh\/blog\/%e5%9c%a8nginx%e7%9a%84%e6%97%a5%e5%bf%97%e4%b8%ad%e8%ae%b0%e5%bd%95%e6%af%8f%e4%b8%aa%e7%94%a8%e6%88%b7%e7%9a%84%e8%ae%bf%e9%97%ae%e8%ae%a1%e6%95%b0%e5%99%a8\/"},"modified":"2024-04-30T04:22:45","modified_gmt":"2024-04-29T20:22:45","slug":"%e5%9c%a8nginx%e7%9a%84%e6%97%a5%e5%bf%97%e4%b8%ad%e8%ae%b0%e5%bd%95%e6%af%8f%e4%b8%aa%e7%94%a8%e6%88%b7%e7%9a%84%e8%ae%bf%e9%97%ae%e8%ae%a1%e6%95%b0%e5%99%a8","status":"publish","type":"post","link":"https:\/\/www.silicloud.com\/zh\/blog\/%e5%9c%a8nginx%e7%9a%84%e6%97%a5%e5%bf%97%e4%b8%ad%e8%ae%b0%e5%bd%95%e6%af%8f%e4%b8%aa%e7%94%a8%e6%88%b7%e7%9a%84%e8%ae%bf%e9%97%ae%e8%ae%a1%e6%95%b0%e5%99%a8\/","title":{"rendered":"\u5728nginx\u7684\u65e5\u5fd7\u4e2d\u8bb0\u5f55\u6bcf\u4e2a\u7528\u6237\u7684\u8bbf\u95ee\u8ba1\u6570\u5668"},"content":{"rendered":"<h2>\u6211\u60f3\u505a\u7684\u4e8b\u60c5<\/h2>\n<p>\u5728\u4f7f\u7528\u7684\u7f51\u7ad9\u4e0a\uff0c\u5c06\u552f\u4e00\u7684\u7528\u6237ID\uff08uid\uff09\u8bb0\u5f55\u5728nginx\u65e5\u5fd7\u4e2d\uff0c\u5e76\u5c06\u65e5\u5fd7\u4f20\u8f93\u5230elasticsearch\uff0c\u56e0\u6b64\u53ef\u4ee5\u8f7b\u677e\u901a\u8fc7kibana\u67e5\u770bDAU\uff08\u8fd8\u5305\u62ecHAU\uff0cWAU\uff0cMAU\uff09\u3002<\/p>\n<p>\u6211\u60f3\u8981\u770b\u5230DAU\uff08\u65e5\u6d3b\u8dc3\u7528\u6237\u6570\uff09\u7684\u7ec6\u5206\uff0c\u4ee5\u4e86\u89e3\u7528\u6237\u4ee5\u591a\u5927\u7684\u9891\u7387\u8bbf\u95ee\u7f51\u7ad9\uff0c\u5e76\u5c06\u4ed6\u4eec\u5206\u6210\u4e0d\u540c\u7684\u7ec4\u522b\uff0c\u56e0\u4e3aDAU\u76ee\u524d\u5305\u542b\u4e86\u65b0\u53c2\u4e0e\u8005\u548c\u4e4b\u524d\u5df2\u7ecf\u8bbf\u95ee\u8fc7\u7684\u4eba\u3002<\/p>\n<ul class=\"post-ul\">\n<li style=\"list-style-type: none;\">\n<ul class=\"post-ul\">\u307b\u307c\u6bce\u65e5\u304d\u3066\u304f\u308c\u308b\u4eba<\/ul>\n<\/li>\n<\/ul>\n<p>&nbsp;<\/p>\n<ul class=\"post-ul\">\n<li style=\"list-style-type: none;\">\n<ul class=\"post-ul\">1\u65e5\u4f55\u56de\u3082\u30ed\u30b0\u30a4\u30f3\u3057\u3066\u308b\u4eba<\/ul>\n<\/li>\n<\/ul>\n<p>&nbsp;<\/p>\n<ul class=\"post-ul\">\u521d\u56de\u53c2\u52a0\u306e\u307f\u306e\u4eba<\/ul>\n<h2>\u8bbe\u5b9a\u7684\u4e1c\u897f<\/h2>\n<ol>\n<li style=\"list-style-type: none;\">\n<ol>\u6bcf\u5f53\u6709\u8bf7\u6c42\u8bbf\u95eenginx\u65f6\uff0c\u66f4\u65b0Redis\u4e2d\u4e3a\u6bcf\u4e2a\u7528\u6237\u51c6\u5907\u7684\u8bbf\u95ee\u8ba1\u6570\u5668\u3002<\/ol>\n<\/li>\n<\/ol>\n<p>&nbsp;<\/p>\n<ol>\n<li style=\"list-style-type: none;\">\n<ol>\u4eceRedis\u4e2d\u8bfb\u53d6\u8bbf\u95ee\u8ba1\u6570\u5668\uff0c\u5e76\u5c06\u8ba1\u6570\u6570\u76ee\u8bb0\u5f55\u5728nginx\u7684\u8bbf\u95ee\u65e5\u5fd7\u4e2d\u3002<\/ol>\n<\/li>\n<\/ol>\n<p>&nbsp;<\/p>\n<ol>\u5c06\u65e5\u5fd7\u5bfc\u5165ElasticSearch\uff0c\u5e76\u901a\u8fc7\u53ef\u89c6\u5316\u5de5\u5177\u5bf9DAU\u8fdb\u884c\u7ec6\u5206\u5e76\u663e\u793a\u3002<\/ol>\n<p>\u867d\u7136\u6211\u8ba4\u4e3a\u6700\u597d\u662f\u5728\u5c06\u65e5\u5fd7\u6d41\u5165ElasticSearch\u4e4b\u65f6\u5904\u7406\uff0c\u4ee5\u9632\u6b62\u7531nginx\u5904\u7406\u5f15\u8d77\u54cd\u5e94\u65f6\u95f4\u4e0b\u964d\uff0c\u4f46\u8fd9\u6b21\u6211\u5141\u8bb8\u4e86\u8fd9\u79cd\u60c5\u51b5\u3002<\/p>\n<h3>nginx\u7684\u914d\u7f6e<\/h3>\n<p>\u56e0\u4e3a\u9700\u8981\u4f7f\u7528 ngx.location.capture\u548c\u4e0eredis\u5efa\u7acb\u8fde\u63a5\uff0c\u6240\u4ee5\u51b3\u5b9a\u4f7f\u7528openresty\u3002<\/p>\n<ul class=\"post-ul\">nginx.conf\uff08\u90e8\u5206\u629c\u7c8b\uff09<\/ul>\n<pre class=\"post-pre\"><code>json_log_fields main 'time_local'\r\n              'x-uid'\r\n              'cnt_hour'\r\n              'cnt_dow'\r\n              'cnt_day'\r\n              'cnt_sec'\r\n\r\nset $uid \"unknown\";\r\nif ($x-uid ~ ([0-9a-z]+)) {\r\n  set $uid $1;\r\n}\r\nstrftime hour \"%H\"; # \u6642\u30000-23\r\nstrftime dow \"%w\" # \u66dc\u65e5 0-6\r\nstrftime day \"%d\"; # \u65e5\u4ed8 01-31\r\nstrftime sec \"%S\"; # \u79d2 01-59\r\nset $cnt_hour \"0\";\r\nset $cnt_dow \"0\";\r\nset $cnt_day \"0\";\r\nset $cnt_sec \"0\";\r\nset $res \"-\";\r\n\r\nlocation \/update_counter {\r\n  internal;\r\n  redis2_raw_queries 2 \"select 15\\r\\nevalsha 7d935b5da11543863d3de7e8af785052aebff453 1 $uid $sec $hour $dow $day\\r\\n\";\r\n  redis2_pass redis_server;\r\n}\r\n\r\nlocation \/get_counter {\r\n  internal;\r\n  redis2_raw_queries 2 \"select 15\\r\\nevalsha b1c165f798a1a3df36bb5f513a7a59efde68d941 1 $uid\\r\\n\";\r\n  redis2_pass redis_server;\r\n}\r\n\r\nlocation \/ {\r\n  access_by_lua '\r\n    ngx.location.capture(\"\/update_counter\")\r\n    local res = ngx.location.capture(\"\/get_counter\")\r\n    ngx.var.res = res.body\r\n    local m, err = ngx.re.match(res.body, \"([0-9]+):([0-9]+):([0-9]+):([0-9]+)\")\r\n    if m then\r\n      ngx.var.cnt_sec = m[1]\r\n      ngx.var.cnt_hour = m[2]\r\n      ngx.var.cnt_dow = m[3]\r\n      ngx.var.cnt_day = m[4]\r\n    end\r\n  ';\r\n  limit_req zone=one burst=2;\r\n  proxy_pass http:\/\/puma-app;\r\n}\r\n<\/code><\/pre>\n<p>evalsha\u3092\u4f7f\u3063\u3066\u5f8c\u8ff0\u306eredis\u306b\u767b\u9332\u3057\u305f\u30b9\u30af\u30ea\u30d7\u30c8\u3092\u547c\u3073\u51fa\u3057\u3066\u3044\u308b\u3002<\/p>\n<p>\/update_counter<\/p>\n<p>uid\u5225\u306b\u6301\u3063\u3066\u3044\u308b\u30a2\u30af\u30bb\u30b9\u30ab\u30a6\u30f3\u30bf\u3092\u66f4\u65b0\u3059\u308b\u3002<\/p>\n<p>\/get_counter<\/p>\n<p>uid\u5225\u306b\u6301\u3063\u3066\u3044\u308b\u30a2\u30af\u30bb\u30b9\u30ab\u30a6\u30f3\u30bf\u3092\u53d6\u5f97\u3059\u308b\u3002<\/p>\n<p>\/location<\/p>\n<p>\/update_counter \/get_counter\u3092\u5b9f\u884c\u3057\u3066\u30a2\u30af\u30bb\u30b9\u30ab\u30a6\u30f3\u30bf\u3092$cnt_sec|hour|dow|day\u306b\u8a2d\u5b9a\u3059\u308b(\u30ed\u30b0\u306b\u305d\u306e\u307e\u307e\u51fa\u529b\u3055\u308c\u308b)<\/p>\n<h3>Redis\u8ba1\u6570\u5668<\/h3>\n<h4>\u4f7f\u7528TTL\u8bbe\u7f6e\u8bbf\u95ee\u8ba1\u6570\u5668\u3002<\/h4>\n<ul class=\"post-ul\">\n<li style=\"list-style-type: none;\">\n<ul class=\"post-ul\">\u76f4\u8fd1\u4e00\u5206\u306e\u30a2\u30af\u30bb\u30b9\u3000\u30ad\u30fc\u540d: &#8220;$uid:sec:[0-59]&#8221; \u5024: 1<\/ul>\n<\/li>\n<\/ul>\n<p>&nbsp;<\/p>\n<ul class=\"post-ul\">\n<li style=\"list-style-type: none;\">\n<ul class=\"post-ul\">\u76f4\u8fd124\u6642\u9593\u306e\u30a2\u30af\u30bb\u30b9\u3000\u30ad\u30fc\u540d: &#8220;$uid:hour:[0-23]&#8221; \u5024: 1<\/ul>\n<\/li>\n<\/ul>\n<p>&nbsp;<\/p>\n<ul class=\"post-ul\">\n<li style=\"list-style-type: none;\">\n<ul class=\"post-ul\">\u76f4\u8fd11\u9031\u9593\u306e\u30a2\u30af\u30bb\u30b9\u3000\u30ad\u30fc\u540d: &#8220;$uid:dow:[0-6]&#8221; \u5024: 1<\/ul>\n<\/li>\n<\/ul>\n<p>&nbsp;<\/p>\n<ul class=\"post-ul\">\u76f4\u8fd130\u65e5\u306e\u30a2\u30af\u30bb\u30b9\u3000\u30ad\u30fc\u540d: &#8220;$uid:day:[01-31]&#8221; \u5024: 1<\/ul>\n<pre class=\"post-pre\"><code>script load \"\r\n redis.call('setex', KEYS[1] .. ':sec:' .. ARGV[1], 60, 1)\r\n redis.call('setex', KEYS[1] .. ':hour:' .. ARGV[2], 86400, 1)\r\n redis.call('setex', KEYS[1] .. ':dow:' .. ARGV[3], 604800, 1)\r\n redis.call('setex', KEYS[1] .. ':day:' .. ARGV[4],2592000, 1)\r\n\"\r\n7d935b5da11543863d3de7e8af785052aebff453\r\n<\/code><\/pre>\n<h4>\u8bfb\u53d6\u8bbf\u95ee\u8ba1\u6570\u5668<\/h4>\n<p>\u30ab\u30a6\u30f3\u30bf\u3092\u8aad\u307f\u51fa\u3059<\/p>\n<p>\u623b\u308a\u5024<\/p>\n<p>\u76f4\u8fd11\u5206\u4ee5\u5185\u306e\u30a2\u30af\u30bb\u30b9\u6570:\u76f4\u8fd124\u6642\u9593\u4ee5\u5185\u306e\u30a2\u30af\u30bb\u30b9\u6570:\u76f4\u8fd17\u65e5\u4ee5\u5185\u306e\u30a2\u30af\u30bb\u30b9\u6570:\u76f4\u8fd130\u65e5\u4ee5\u5185\u306e\u30a2\u30af\u30bb\u30b9\u6570<br \/>\n(\u30a2\u30af\u30bb\u30b9\u6570\u306f\u5408\u8a08\u5024\u3067\u306f\u306a\u304f\u3066\u5358\u4f4d\u3042\u305f\u308a\u306e\u30e6\u30cb\u30fc\u30af\u30ab\u30a6\u30f3\u30c8\u3068\u3059\u308b\u3002\u4f8b\u3048\u3070\u91d1\u66dc\u65e51\u56de\u3001\u571f\u66dc\u65e5100\u56de\u30a2\u30af\u30bb\u30b9\u3057\u3066\u30821\u9031\u9593\u306e\u30a2\u30af\u30bb\u30b9\u306f2\uff09<\/p>\n<pre class=\"post-pre\"><code>script load \"\r\n local sec = 0\r\n local hour = 0\r\n local dow = 0\r\n local day = 0\r\n local ret = nil\r\n for i = 0,59 do\r\n   ret = redis.call('get', KEYS[1] .. ':sec:' .. string.format('%02d', i))\r\n   if ret then\r\n    sec = sec + 1\r\n   end\r\n end\r\n for i = 0,23 do\r\n   ret = redis.call('get', KEYS[1] .. ':hour:' .. string.format('%02d', i))\r\n   if ret then\r\n    hour = hour + 1\r\n   end\r\n end\r\n for i = 0,6 do\r\n   ret = redis.call('get', KEYS[1] .. ':dow:' .. string.format('%1d', i))\r\n   if ret then\r\n    dow = dow + 1\r\n   end\r\n end\r\n for i = 1,31 do\r\n   ret = redis.call('get', KEYS[1] .. ':day:' .. string.format('%02d', i))\r\n   if ret then\r\n    day = day + 1\r\n   end\r\n end\r\n return string.format('%d:%d:%d:%d', sec, hour, dow, day)\r\n\"\r\n\r\nb1c165f798a1a3df36bb5f513a7a59efde68d941\r\n<\/code><\/pre>\n<ul class=\"post-ul\">\u30e6\u30fc\u30b61\u56de\u306e\u30a2\u30af\u30bb\u30b9\u3067redis\u306e\u64cd\u4f5c\u304c120\u56de\u4ee5\u4e0a\u767a\u751f\u3057\u3066\u3044\u308b\u306e\u306f\u307e\u305a\u3044\u304b\u3002<\/ul>\n<h3>\u5728Kibana\u4e0a\u7684\u53ef\u89c6\u5316<\/h3>\n<ul class=\"post-ul\">\n<li style=\"list-style-type: none;\">\n<ul class=\"post-ul\">\u4f8b) \u76f4\u8fd1\u4e00\u9031\u9593\u306e\u3046\u3061\u4f55\u56de\u304d\u3066\u308b\u304b\u3067DAU\u3092\u30b0\u30eb\u30fc\u30d4\u30f3\u30b0\u3057\u3066\u8868\u793a\u3059\u308b<\/ul>\n<\/li>\n<\/ul>\n<p>Y-axis\u3000x-uid\u3067unique count<br \/>\nX-axis\u3000\u30bf\u30a4\u30e0\u30b9\u30bf\u30f3\u30d7<br \/>\nsplit bars -&gt; Histgram -&gt; cnt_dow -&gt; interval 1<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u6211\u60f3\u505a\u7684\u4e8b\u60c5 \u5728\u4f7f\u7528\u7684\u7f51\u7ad9\u4e0a\uff0c\u5c06\u552f\u4e00\u7684\u7528\u6237ID\uff08uid\uff09\u8bb0\u5f55\u5728nginx\u65e5\u5fd7\u4e2d\uff0c\u5e76\u5c06\u65e5\u5fd7\u4f20\u8f93\u5230elastics [&hellip;]<\/p>\n","protected":false},"author":7,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-34299","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v21.5 (Yoast SEO v21.5) - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>\u5728nginx\u7684\u65e5\u5fd7\u4e2d\u8bb0\u5f55\u6bcf\u4e2a\u7528\u6237\u7684\u8bbf\u95ee\u8ba1\u6570\u5668 - Blog - Silicon Cloud<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.silicloud.com\/zh\/blog\/\u5728nginx\u7684\u65e5\u5fd7\u4e2d\u8bb0\u5f55\u6bcf\u4e2a\u7528\u6237\u7684\u8bbf\u95ee\u8ba1\u6570\u5668\/\" \/>\n<meta property=\"og:locale\" content=\"zh_CN\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"\u5728nginx\u7684\u65e5\u5fd7\u4e2d\u8bb0\u5f55\u6bcf\u4e2a\u7528\u6237\u7684\u8bbf\u95ee\u8ba1\u6570\u5668\" \/>\n<meta property=\"og:description\" content=\"\u6211\u60f3\u505a\u7684\u4e8b\u60c5 \u5728\u4f7f\u7528\u7684\u7f51\u7ad9\u4e0a\uff0c\u5c06\u552f\u4e00\u7684\u7528\u6237ID\uff08uid\uff09\u8bb0\u5f55\u5728nginx\u65e5\u5fd7\u4e2d\uff0c\u5e76\u5c06\u65e5\u5fd7\u4f20\u8f93\u5230elastics [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.silicloud.com\/zh\/blog\/\u5728nginx\u7684\u65e5\u5fd7\u4e2d\u8bb0\u5f55\u6bcf\u4e2a\u7528\u6237\u7684\u8bbf\u95ee\u8ba1\u6570\u5668\/\" \/>\n<meta property=\"og:site_name\" content=\"Blog - Silicon Cloud\" \/>\n<meta property=\"article:published_time\" content=\"2023-05-08T12:33:41+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2024-04-29T20:22:45+00:00\" \/>\n<meta name=\"author\" content=\"\u79d1, \u9896\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"\u4f5c\u8005\" \/>\n\t<meta name=\"twitter:data1\" content=\"\u79d1, \u9896\" \/>\n\t<meta name=\"twitter:label2\" content=\"\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4\" \/>\n\t<meta name=\"twitter:data2\" content=\"2 \u5206\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/%e5%9c%a8nginx%e7%9a%84%e6%97%a5%e5%bf%97%e4%b8%ad%e8%ae%b0%e5%bd%95%e6%af%8f%e4%b8%aa%e7%94%a8%e6%88%b7%e7%9a%84%e8%ae%bf%e9%97%ae%e8%ae%a1%e6%95%b0%e5%99%a8\/\",\"url\":\"https:\/\/www.silicloud.com\/zh\/blog\/%e5%9c%a8nginx%e7%9a%84%e6%97%a5%e5%bf%97%e4%b8%ad%e8%ae%b0%e5%bd%95%e6%af%8f%e4%b8%aa%e7%94%a8%e6%88%b7%e7%9a%84%e8%ae%bf%e9%97%ae%e8%ae%a1%e6%95%b0%e5%99%a8\/\",\"name\":\"\u5728nginx\u7684\u65e5\u5fd7\u4e2d\u8bb0\u5f55\u6bcf\u4e2a\u7528\u6237\u7684\u8bbf\u95ee\u8ba1\u6570\u5668 - Blog - Silicon Cloud\",\"isPartOf\":{\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/#website\"},\"datePublished\":\"2023-05-08T12:33:41+00:00\",\"dateModified\":\"2024-04-29T20:22:45+00:00\",\"author\":{\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/#\/schema\/person\/8ca01ba7f7362ad4edb7da206a12f29e\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/%e5%9c%a8nginx%e7%9a%84%e6%97%a5%e5%bf%97%e4%b8%ad%e8%ae%b0%e5%bd%95%e6%af%8f%e4%b8%aa%e7%94%a8%e6%88%b7%e7%9a%84%e8%ae%bf%e9%97%ae%e8%ae%a1%e6%95%b0%e5%99%a8\/#breadcrumb\"},\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.silicloud.com\/zh\/blog\/%e5%9c%a8nginx%e7%9a%84%e6%97%a5%e5%bf%97%e4%b8%ad%e8%ae%b0%e5%bd%95%e6%af%8f%e4%b8%aa%e7%94%a8%e6%88%b7%e7%9a%84%e8%ae%bf%e9%97%ae%e8%ae%a1%e6%95%b0%e5%99%a8\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/%e5%9c%a8nginx%e7%9a%84%e6%97%a5%e5%bf%97%e4%b8%ad%e8%ae%b0%e5%bd%95%e6%af%8f%e4%b8%aa%e7%94%a8%e6%88%b7%e7%9a%84%e8%ae%bf%e9%97%ae%e8%ae%a1%e6%95%b0%e5%99%a8\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u9996\u9875\",\"item\":\"https:\/\/www.silicloud.com\/zh\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"\u5728nginx\u7684\u65e5\u5fd7\u4e2d\u8bb0\u5f55\u6bcf\u4e2a\u7528\u6237\u7684\u8bbf\u95ee\u8ba1\u6570\u5668\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/#website\",\"url\":\"https:\/\/www.silicloud.com\/zh\/blog\/\",\"name\":\"Blog - Silicon Cloud\",\"description\":\"\",\"inLanguage\":\"zh-Hans\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/#\/schema\/person\/8ca01ba7f7362ad4edb7da206a12f29e\",\"name\":\"\u79d1, \u9896\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"zh-Hans\",\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/8a6fb3cc7ba2f69d2189ba532aec4633ea7ed75ac0af162ec367cb3abc0fb2af?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/8a6fb3cc7ba2f69d2189ba532aec4633ea7ed75ac0af162ec367cb3abc0fb2af?s=96&d=mm&r=g\",\"caption\":\"\u79d1, \u9896\"},\"url\":\"https:\/\/www.silicloud.com\/zh\/blog\/author\/keying\/\"},{\"@type\":\"ImageObject\",\"inLanguage\":\"zh-Hans\",\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/%e5%9c%a8nginx%e7%9a%84%e6%97%a5%e5%bf%97%e4%b8%ad%e8%ae%b0%e5%bd%95%e6%af%8f%e4%b8%aa%e7%94%a8%e6%88%b7%e7%9a%84%e8%ae%bf%e9%97%ae%e8%ae%a1%e6%95%b0%e5%99%a8\/#local-main-organization-logo\",\"url\":\"\",\"contentUrl\":\"\",\"caption\":\"Blog - Silicon Cloud\"}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"\u5728nginx\u7684\u65e5\u5fd7\u4e2d\u8bb0\u5f55\u6bcf\u4e2a\u7528\u6237\u7684\u8bbf\u95ee\u8ba1\u6570\u5668 - Blog - Silicon Cloud","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.silicloud.com\/zh\/blog\/\u5728nginx\u7684\u65e5\u5fd7\u4e2d\u8bb0\u5f55\u6bcf\u4e2a\u7528\u6237\u7684\u8bbf\u95ee\u8ba1\u6570\u5668\/","og_locale":"zh_CN","og_type":"article","og_title":"\u5728nginx\u7684\u65e5\u5fd7\u4e2d\u8bb0\u5f55\u6bcf\u4e2a\u7528\u6237\u7684\u8bbf\u95ee\u8ba1\u6570\u5668","og_description":"\u6211\u60f3\u505a\u7684\u4e8b\u60c5 \u5728\u4f7f\u7528\u7684\u7f51\u7ad9\u4e0a\uff0c\u5c06\u552f\u4e00\u7684\u7528\u6237ID\uff08uid\uff09\u8bb0\u5f55\u5728nginx\u65e5\u5fd7\u4e2d\uff0c\u5e76\u5c06\u65e5\u5fd7\u4f20\u8f93\u5230elastics [&hellip;]","og_url":"https:\/\/www.silicloud.com\/zh\/blog\/\u5728nginx\u7684\u65e5\u5fd7\u4e2d\u8bb0\u5f55\u6bcf\u4e2a\u7528\u6237\u7684\u8bbf\u95ee\u8ba1\u6570\u5668\/","og_site_name":"Blog - Silicon Cloud","article_published_time":"2023-05-08T12:33:41+00:00","article_modified_time":"2024-04-29T20:22:45+00:00","author":"\u79d1, \u9896","twitter_card":"summary_large_image","twitter_misc":{"\u4f5c\u8005":"\u79d1, \u9896","\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4":"2 \u5206"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.silicloud.com\/zh\/blog\/%e5%9c%a8nginx%e7%9a%84%e6%97%a5%e5%bf%97%e4%b8%ad%e8%ae%b0%e5%bd%95%e6%af%8f%e4%b8%aa%e7%94%a8%e6%88%b7%e7%9a%84%e8%ae%bf%e9%97%ae%e8%ae%a1%e6%95%b0%e5%99%a8\/","url":"https:\/\/www.silicloud.com\/zh\/blog\/%e5%9c%a8nginx%e7%9a%84%e6%97%a5%e5%bf%97%e4%b8%ad%e8%ae%b0%e5%bd%95%e6%af%8f%e4%b8%aa%e7%94%a8%e6%88%b7%e7%9a%84%e8%ae%bf%e9%97%ae%e8%ae%a1%e6%95%b0%e5%99%a8\/","name":"\u5728nginx\u7684\u65e5\u5fd7\u4e2d\u8bb0\u5f55\u6bcf\u4e2a\u7528\u6237\u7684\u8bbf\u95ee\u8ba1\u6570\u5668 - Blog - Silicon Cloud","isPartOf":{"@id":"https:\/\/www.silicloud.com\/zh\/blog\/#website"},"datePublished":"2023-05-08T12:33:41+00:00","dateModified":"2024-04-29T20:22:45+00:00","author":{"@id":"https:\/\/www.silicloud.com\/zh\/blog\/#\/schema\/person\/8ca01ba7f7362ad4edb7da206a12f29e"},"breadcrumb":{"@id":"https:\/\/www.silicloud.com\/zh\/blog\/%e5%9c%a8nginx%e7%9a%84%e6%97%a5%e5%bf%97%e4%b8%ad%e8%ae%b0%e5%bd%95%e6%af%8f%e4%b8%aa%e7%94%a8%e6%88%b7%e7%9a%84%e8%ae%bf%e9%97%ae%e8%ae%a1%e6%95%b0%e5%99%a8\/#breadcrumb"},"inLanguage":"zh-Hans","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.silicloud.com\/zh\/blog\/%e5%9c%a8nginx%e7%9a%84%e6%97%a5%e5%bf%97%e4%b8%ad%e8%ae%b0%e5%bd%95%e6%af%8f%e4%b8%aa%e7%94%a8%e6%88%b7%e7%9a%84%e8%ae%bf%e9%97%ae%e8%ae%a1%e6%95%b0%e5%99%a8\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.silicloud.com\/zh\/blog\/%e5%9c%a8nginx%e7%9a%84%e6%97%a5%e5%bf%97%e4%b8%ad%e8%ae%b0%e5%bd%95%e6%af%8f%e4%b8%aa%e7%94%a8%e6%88%b7%e7%9a%84%e8%ae%bf%e9%97%ae%e8%ae%a1%e6%95%b0%e5%99%a8\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u9996\u9875","item":"https:\/\/www.silicloud.com\/zh\/blog\/"},{"@type":"ListItem","position":2,"name":"\u5728nginx\u7684\u65e5\u5fd7\u4e2d\u8bb0\u5f55\u6bcf\u4e2a\u7528\u6237\u7684\u8bbf\u95ee\u8ba1\u6570\u5668"}]},{"@type":"WebSite","@id":"https:\/\/www.silicloud.com\/zh\/blog\/#website","url":"https:\/\/www.silicloud.com\/zh\/blog\/","name":"Blog - Silicon Cloud","description":"","inLanguage":"zh-Hans"},{"@type":"Person","@id":"https:\/\/www.silicloud.com\/zh\/blog\/#\/schema\/person\/8ca01ba7f7362ad4edb7da206a12f29e","name":"\u79d1, \u9896","image":{"@type":"ImageObject","inLanguage":"zh-Hans","@id":"https:\/\/www.silicloud.com\/zh\/blog\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/8a6fb3cc7ba2f69d2189ba532aec4633ea7ed75ac0af162ec367cb3abc0fb2af?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/8a6fb3cc7ba2f69d2189ba532aec4633ea7ed75ac0af162ec367cb3abc0fb2af?s=96&d=mm&r=g","caption":"\u79d1, \u9896"},"url":"https:\/\/www.silicloud.com\/zh\/blog\/author\/keying\/"},{"@type":"ImageObject","inLanguage":"zh-Hans","@id":"https:\/\/www.silicloud.com\/zh\/blog\/%e5%9c%a8nginx%e7%9a%84%e6%97%a5%e5%bf%97%e4%b8%ad%e8%ae%b0%e5%bd%95%e6%af%8f%e4%b8%aa%e7%94%a8%e6%88%b7%e7%9a%84%e8%ae%bf%e9%97%ae%e8%ae%a1%e6%95%b0%e5%99%a8\/#local-main-organization-logo","url":"","contentUrl":"","caption":"Blog - Silicon Cloud"}]}},"_links":{"self":[{"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/posts\/34299","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/users\/7"}],"replies":[{"embeddable":true,"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/comments?post=34299"}],"version-history":[{"count":2,"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/posts\/34299\/revisions"}],"predecessor-version":[{"id":89653,"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/posts\/34299\/revisions\/89653"}],"wp:attachment":[{"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/media?parent=34299"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/categories?post=34299"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/tags?post=34299"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}