{"id":1180,"date":"2022-08-19T15:47:27","date_gmt":"2022-08-19T07:47:27","guid":{"rendered":"https:\/\/www.linuxdevops.cn\/?p=1180"},"modified":"2023-04-07T09:53:16","modified_gmt":"2023-04-07T01:53:16","slug":"nginx-ingress-shields-an-interface-and-restricts-ip","status":"publish","type":"post","link":"https:\/\/www.linuxdevops.cn\/2022\/08\/nginx-ingress-shields-an-interface-and-restricts-ip\/","title":{"rendered":"NGINX ingress \u5c4f\u853d\u67d0\u4e2a\u63a5\u53e3\uff0c\u9488\u5bf9\u67d0\u4e2a\u63a5\u53e3\u8fdb\u884cIP\u767d\u540d\u5355\u8bbf\u95ee\u9650\u5236"},"content":{"rendered":"

\u4e00\u3001if\u8bed\u53e5\u4e2d\u7684\u5224\u65ad\u6761\u4ef6(nginx)<\/p>\n

1\u3001\u6b63\u5219\u8868\u8fbe\u5f0f\u5339\u914d\uff1a<\/p>\n

==:\u7b49\u503c\u6bd4\u8f83;\n~\uff1a\u4e0e\u6307\u5b9a\u6b63\u5219\u8868\u8fbe\u5f0f\u6a21\u5f0f\u5339\u914d\u65f6\u8fd4\u56de\u201c\u771f\u201d\uff0c\u5224\u65ad\u5339\u914d\u4e0e\u5426\u65f6\u533a\u5206\u5b57\u7b26\u5927\u5c0f\u5199\uff1b\n~*\uff1a\u4e0e\u6307\u5b9a\u6b63\u5219\u8868\u8fbe\u5f0f\u6a21\u5f0f\u5339\u914d\u65f6\u8fd4\u56de\u201c\u771f\u201d\uff0c\u5224\u65ad\u5339\u914d\u4e0e\u5426\u65f6\u4e0d\u533a\u5206\u5b57\u7b26\u5927\u5c0f\u5199\uff1b\n!~\uff1a\u4e0e\u6307\u5b9a\u6b63\u5219\u8868\u8fbe\u5f0f\u6a21\u5f0f\u4e0d\u5339\u914d\u65f6\u8fd4\u56de\u201c\u771f\u201d\uff0c\u5224\u65ad\u5339\u914d\u4e0e\u5426\u65f6\u533a\u5206\u5b57\u7b26\u5927\u5c0f\u5199\uff1b\n!~*\uff1a\u4e0e\u6307\u5b9a\u6b63\u5219\u8868\u8fbe\u5f0f\u6a21\u5f0f\u4e0d\u5339\u914d\u65f6\u8fd4\u56de\u201c\u771f\u201d\uff0c\u5224\u65ad\u5339\u914d\u4e0e\u5426\u65f6\u4e0d\u533a\u5206\u5b57\u7b26\u5927\u5c0f\u5199\uff1b<\/code><\/pre>\n

2\u3001\u6587\u4ef6\u53ca\u76ee\u5f55\u5339\u914d\u5224\u65ad\uff1a<\/p>\n

-f, !-f\uff1a\u5224\u65ad\u6307\u5b9a\u7684\u8def\u5f84\u662f\u5426\u4e3a\u5b58\u5728\u4e14\u4e3a\u6587\u4ef6\uff1b\n-d, !-d\uff1a\u5224\u65ad\u6307\u5b9a\u7684\u8def\u5f84\u662f\u5426\u4e3a\u5b58\u5728\u4e14\u4e3a\u76ee\u5f55\uff1b\n-e, !-e\uff1a\u5224\u65ad\u6307\u5b9a\u7684\u8def\u5f84\u662f\u5426\u5b58\u5728\uff0c\u6587\u4ef6\u6216\u76ee\u5f55\u5747\u53ef\uff1b\n-x, !-x\uff1a\u5224\u65ad\u6307\u5b9a\u8def\u5f84\u7684\u6587\u4ef6\u662f\u5426\u5b58\u5728\u4e14\u53ef\u6267\u884c\uff1b<\/code><\/pre>\n

\u4e8c\u3001\u573a\u666f\u793a\u4f8b<\/p>\n

\u516c\u53f8API\u6587\u6863\u5305\u542b\u5728\u67d0\u4e2aJava\u5e94\u7528\u6216\u8005Golang\u5e94\u7528\u4e2d\uff0c\u6211\u4eec\u53ea\u9488\u5bf9API\u6587\u6863\u63a5\u53e3\u8fdb\u884c\u5c4f\u853d\u6216\u8005\u9650\u5236IP\u8bbf\u95ee\uff0c\u5176\u4f59\u63a5\u53e3\u5219\u662f\u6b63\u5e38\u8bbf\u95ee\u3002<\/p>\n

\u3010\u793a\u4f8b1\u3011\u76f4\u63a5\u5c4f\u853d\u6389\u63a5\u53e3\u6587\u6863<\/p>\n

    #\u6dfb\u52a0nginx ingress\u6ce8\u89e3\uff0c\u5982\u679c\u8bf7\u6c42url\u4e2d\u5305\u542b"\/doc.html|\/swagger" \u5219\u8fd4\u56de403\n    nginx.ingress.kubernetes.io\/server-snippet: |\n      if ( $request_uri ~*  (\/doc.html|\/swagger)) {\n                 return 403;\n      }<\/code><\/pre>\n

\u3010\u793a\u4f8b2\u3011\u63a5\u53e3\u53ea\u5f00\u653e\u67d0\u4e2aIP\u767d\u540d\u5355\u8fdb\u884c\u8bbf\u95ee<\/p>\n

\n

nginx\u7684\u914d\u7f6e\u4e2d\u4e0d\u652f\u6301if\u6761\u4ef6\u7684\u903b\u8f91\u4e0e\uff0f\u903b\u8f91\u6216\u8fd0\u7b97 \uff0c\u5e76\u4e14\u4e0d\u652f\u6301if\u7684\u5d4c\u5957\u8bed\u6cd5\uff0c\u6211\u4eec\u53ef\u4ee5\u7528\u53d8\u91cf\u7684\u65b9\u5f0f\u6765\u5b9e\u73b0\uff1a<\/p>\n

 #\u9996\u5148\u662f\u4f2a\u4ee3\u7801\uff08\u5373\u4e0d\u88abnginx\u652f\u6301\uff09\uff0c\u5199\u5728\u8fd9\u91cc\u53ea\u662f\u4e3a\u4e86\u65b9\u4fbf\u7406\u89e3\uff1a\n #\u89e3\u6790\uff1a\u5982\u679c\u8bbf\u95ee\u8bf7\u6c42url\u4e2d\u5305\u542b\"\/doc.html|\/swagger\"\u5e76\u4e14\u8bbf\u95eeIP\u4e0d\u662f\u516c\u53f8IP 222.222.222.222 \u5c31\u8fd4\u56de403\uff0c\u53cd\u4e4b\u5982\u679c\u662f\u516c\u53f8IP\u7684\u8bdd\u5c31\u6b63\u5e38\u8bbf\u95ee\u3002\n if ( $request_uri ~*  (\/doc.html|\/swagger) &&  $remote_addr !~* ^222.222.222.222 ) {\n      return 403;\n }<\/code><\/pre>\n<\/blockquote>\n

\u4e0a\u9762\u8bed\u6cd5\u4e0d\u88abNGINX\u652f\u6301\uff0c\u4e0b\u9762\u662fNGINX\u6216\u8005NGINX ingress \u652f\u6301\u7684\u6b63\u786e\u8bed\u6cd5\uff0c\u7528\u53d8\u91cf\u7684\u65b9\u5f0f\u6765\u5b9e\u73b0\u3002<\/p>\n

#NGINX ingress \u914d\u7f6e\u793a\u4f8b  \nnginx.ingress.kubernetes.io\/server-snippet: |\n  set $test '';\n  if ($request_uri ~*  (\/doc.html|\/swagger)){  \n          set $test 1;\n  }\n  if ( $remote_addr !~* 222.222.222.222 ) {\n          set $test "${test}2";\n  }\n  if ( $test = 12 ) {\n          return 403;\n  }<\/code><\/pre>\n

\u53c2\u8003\uff1ahttps:\/\/nestealin.com\/31f5fa47\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"

\u4e00\u3001if\u8bed\u53e5\u4e2d\u7684\u5224\u65ad\u6761\u4ef6(nginx) 1\u3001\u6b63\u5219\u8868\u8fbe\u5f0f\u5339\u914d\uff1a ==:\u7b49\u503c\u6bd4\u8f83; ~\uff1a\u4e0e\u6307\u5b9a\u6b63\u5219\u8868\u8fbe\u5f0f\u6a21\u5f0f\u5339\u914d\u65f6<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[34],"tags":[118,21,117,119],"yoast_head":"\nNGINX ingress \u5c4f\u853d\u67d0\u4e2a\u63a5\u53e3\uff0c\u9488\u5bf9\u67d0\u4e2a\u63a5\u53e3\u8fdb\u884cIP\u767d\u540d\u5355\u8bbf\u95ee\u9650\u5236 - Linux\u81ea\u52a8\u5316\u8fd0\u7ef4<\/title>\n<meta name=\"description\" content=\"\u672c\u6587\u4ecb\u7ecd\u4e86\u5982\u4f55\u4f7f\u7528 Nginx Ingress \u63a7\u5236\u548c\u9650\u5236\u8bbf\u95ee\u60a8\u7684 Kubernetes \u96c6\u7fa4\u4e2d\u7684\u670d\u52a1\u63a5\u53e3\u3002\u6211\u4eec\u5c06\u63a2\u8ba8\u5982\u4f55\u8bbe\u7f6e Nginx Ingress \u4ee5\u5141\u8bb8\u6216\u62d2\u7edd\u6765\u81ea\u7279\u5b9a IP \u5730\u5740\u7684\u8bf7\u6c42\uff0c\u5e76\u6f14\u793a\u5982\u4f55\u4f7f\u7528 NetworkPolicy \u5728 Kubernetes \u4e2d\u5b9e\u73b0\u66f4\u4e25\u683c\u7684\u8bbf\u95ee\u63a7\u5236\u3002\" \/>\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.linuxdevops.cn\/2022\/08\/nginx-ingress-shields-an-interface-and-restricts-ip\/\" \/>\n<meta property=\"og:locale\" content=\"zh_CN\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"NGINX ingress \u5c4f\u853d\u67d0\u4e2a\u63a5\u53e3\uff0c\u9488\u5bf9\u67d0\u4e2a\u63a5\u53e3\u8fdb\u884cIP\u767d\u540d\u5355\u8bbf\u95ee\u9650\u5236 - Linux\u81ea\u52a8\u5316\u8fd0\u7ef4\" \/>\n<meta property=\"og:description\" content=\"\u672c\u6587\u4ecb\u7ecd\u4e86\u5982\u4f55\u4f7f\u7528 Nginx Ingress \u63a7\u5236\u548c\u9650\u5236\u8bbf\u95ee\u60a8\u7684 Kubernetes \u96c6\u7fa4\u4e2d\u7684\u670d\u52a1\u63a5\u53e3\u3002\u6211\u4eec\u5c06\u63a2\u8ba8\u5982\u4f55\u8bbe\u7f6e Nginx Ingress \u4ee5\u5141\u8bb8\u6216\u62d2\u7edd\u6765\u81ea\u7279\u5b9a IP \u5730\u5740\u7684\u8bf7\u6c42\uff0c\u5e76\u6f14\u793a\u5982\u4f55\u4f7f\u7528 NetworkPolicy \u5728 Kubernetes \u4e2d\u5b9e\u73b0\u66f4\u4e25\u683c\u7684\u8bbf\u95ee\u63a7\u5236\u3002\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.linuxdevops.cn\/2022\/08\/nginx-ingress-shields-an-interface-and-restricts-ip\/\" \/>\n<meta property=\"og:site_name\" content=\"Linux\u81ea\u52a8\u5316\u8fd0\u7ef4\" \/>\n<meta property=\"article:published_time\" content=\"2022-08-19T07:47:27+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2023-04-07T01:53:16+00:00\" \/>\n<meta name=\"author\" content=\"\u7ba1\u7406\u5458\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/www.linuxdevops.cn\/2022\/08\/nginx-ingress-shields-an-interface-and-restricts-ip\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/www.linuxdevops.cn\/2022\/08\/nginx-ingress-shields-an-interface-and-restricts-ip\/\"},\"author\":{\"name\":\"\u7ba1\u7406\u5458\",\"@id\":\"https:\/\/www.linuxdevops.cn\/#\/schema\/person\/3e206335d5796fdd8679e449df72a0d1\"},\"headline\":\"NGINX ingress \u5c4f\u853d\u67d0\u4e2a\u63a5\u53e3\uff0c\u9488\u5bf9\u67d0\u4e2a\u63a5\u53e3\u8fdb\u884cIP\u767d\u540d\u5355\u8bbf\u95ee\u9650\u5236\",\"datePublished\":\"2022-08-19T07:47:27+00:00\",\"dateModified\":\"2023-04-07T01:53:16+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/www.linuxdevops.cn\/2022\/08\/nginx-ingress-shields-an-interface-and-restricts-ip\/\"},\"wordCount\":23,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/www.linuxdevops.cn\/#\/schema\/person\/3e206335d5796fdd8679e449df72a0d1\"},\"keywords\":[\"ip\u767d\u540d\u5355\",\"NGINX\",\"nginx ingress\",\"\u63a5\u53e3IP\u767d\u540d\u5355\"],\"articleSection\":[\"Kubernetes\"],\"inLanguage\":\"zh-CN\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/www.linuxdevops.cn\/2022\/08\/nginx-ingress-shields-an-interface-and-restricts-ip\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.linuxdevops.cn\/2022\/08\/nginx-ingress-shields-an-interface-and-restricts-ip\/\",\"url\":\"https:\/\/www.linuxdevops.cn\/2022\/08\/nginx-ingress-shields-an-interface-and-restricts-ip\/\",\"name\":\"NGINX ingress \u5c4f\u853d\u67d0\u4e2a\u63a5\u53e3\uff0c\u9488\u5bf9\u67d0\u4e2a\u63a5\u53e3\u8fdb\u884cIP\u767d\u540d\u5355\u8bbf\u95ee\u9650\u5236 - Linux\u81ea\u52a8\u5316\u8fd0\u7ef4\",\"isPartOf\":{\"@id\":\"https:\/\/www.linuxdevops.cn\/#website\"},\"datePublished\":\"2022-08-19T07:47:27+00:00\",\"dateModified\":\"2023-04-07T01:53:16+00:00\",\"description\":\"\u672c\u6587\u4ecb\u7ecd\u4e86\u5982\u4f55\u4f7f\u7528 Nginx Ingress \u63a7\u5236\u548c\u9650\u5236\u8bbf\u95ee\u60a8\u7684 Kubernetes \u96c6\u7fa4\u4e2d\u7684\u670d\u52a1\u63a5\u53e3\u3002\u6211\u4eec\u5c06\u63a2\u8ba8\u5982\u4f55\u8bbe\u7f6e Nginx Ingress \u4ee5\u5141\u8bb8\u6216\u62d2\u7edd\u6765\u81ea\u7279\u5b9a IP \u5730\u5740\u7684\u8bf7\u6c42\uff0c\u5e76\u6f14\u793a\u5982\u4f55\u4f7f\u7528 NetworkPolicy \u5728 Kubernetes \u4e2d\u5b9e\u73b0\u66f4\u4e25\u683c\u7684\u8bbf\u95ee\u63a7\u5236\u3002\",\"breadcrumb\":{\"@id\":\"https:\/\/www.linuxdevops.cn\/2022\/08\/nginx-ingress-shields-an-interface-and-restricts-ip\/#breadcrumb\"},\"inLanguage\":\"zh-CN\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.linuxdevops.cn\/2022\/08\/nginx-ingress-shields-an-interface-and-restricts-ip\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.linuxdevops.cn\/2022\/08\/nginx-ingress-shields-an-interface-and-restricts-ip\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u9996\u9875\",\"item\":\"https:\/\/www.linuxdevops.cn\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"kubernetes\",\"item\":\"https:\/\/www.linuxdevops.cn\/kubernetes\/\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"NGINX ingress \u5c4f\u853d\u67d0\u4e2a\u63a5\u53e3\uff0c\u9488\u5bf9\u67d0\u4e2a\u63a5\u53e3\u8fdb\u884cIP\u767d\u540d\u5355\u8bbf\u95ee\u9650\u5236\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.linuxdevops.cn\/#website\",\"url\":\"https:\/\/www.linuxdevops.cn\/\",\"name\":\"Linux\u81ea\u52a8\u5316\u8fd0\u7ef4\",\"description\":\"Linux\u81ea\u52a8\u5316\u8fd0\u7ef4\u7b14\u8bb0\",\"publisher\":{\"@id\":\"https:\/\/www.linuxdevops.cn\/#\/schema\/person\/3e206335d5796fdd8679e449df72a0d1\"},\"alternateName\":\"linuxdevops\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.linuxdevops.cn\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"zh-CN\"},{\"@type\":[\"Person\",\"Organization\"],\"@id\":\"https:\/\/www.linuxdevops.cn\/#\/schema\/person\/3e206335d5796fdd8679e449df72a0d1\",\"name\":\"\u7ba1\u7406\u5458\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"zh-CN\",\"@id\":\"https:\/\/www.linuxdevops.cn\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/www.linuxdevops.cn\/wp-content\/uploads\/2019\/07\/cropped-index.jpg\",\"contentUrl\":\"https:\/\/www.linuxdevops.cn\/wp-content\/uploads\/2019\/07\/cropped-index.jpg\",\"width\":512,\"height\":512,\"caption\":\"\u7ba1\u7406\u5458\"},\"logo\":{\"@id\":\"https:\/\/www.linuxdevops.cn\/#\/schema\/person\/image\/\"},\"description\":\"\u7ba1\u7406\u5458\",\"url\":\"https:\/\/www.linuxdevops.cn\/author\/root\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"NGINX ingress \u5c4f\u853d\u67d0\u4e2a\u63a5\u53e3\uff0c\u9488\u5bf9\u67d0\u4e2a\u63a5\u53e3\u8fdb\u884cIP\u767d\u540d\u5355\u8bbf\u95ee\u9650\u5236 - Linux\u81ea\u52a8\u5316\u8fd0\u7ef4","description":"\u672c\u6587\u4ecb\u7ecd\u4e86\u5982\u4f55\u4f7f\u7528 Nginx Ingress \u63a7\u5236\u548c\u9650\u5236\u8bbf\u95ee\u60a8\u7684 Kubernetes \u96c6\u7fa4\u4e2d\u7684\u670d\u52a1\u63a5\u53e3\u3002\u6211\u4eec\u5c06\u63a2\u8ba8\u5982\u4f55\u8bbe\u7f6e Nginx Ingress \u4ee5\u5141\u8bb8\u6216\u62d2\u7edd\u6765\u81ea\u7279\u5b9a IP \u5730\u5740\u7684\u8bf7\u6c42\uff0c\u5e76\u6f14\u793a\u5982\u4f55\u4f7f\u7528 NetworkPolicy \u5728 Kubernetes \u4e2d\u5b9e\u73b0\u66f4\u4e25\u683c\u7684\u8bbf\u95ee\u63a7\u5236\u3002","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.linuxdevops.cn\/2022\/08\/nginx-ingress-shields-an-interface-and-restricts-ip\/","og_locale":"zh_CN","og_type":"article","og_title":"NGINX ingress \u5c4f\u853d\u67d0\u4e2a\u63a5\u53e3\uff0c\u9488\u5bf9\u67d0\u4e2a\u63a5\u53e3\u8fdb\u884cIP\u767d\u540d\u5355\u8bbf\u95ee\u9650\u5236 - Linux\u81ea\u52a8\u5316\u8fd0\u7ef4","og_description":"\u672c\u6587\u4ecb\u7ecd\u4e86\u5982\u4f55\u4f7f\u7528 Nginx Ingress \u63a7\u5236\u548c\u9650\u5236\u8bbf\u95ee\u60a8\u7684 Kubernetes \u96c6\u7fa4\u4e2d\u7684\u670d\u52a1\u63a5\u53e3\u3002\u6211\u4eec\u5c06\u63a2\u8ba8\u5982\u4f55\u8bbe\u7f6e Nginx Ingress \u4ee5\u5141\u8bb8\u6216\u62d2\u7edd\u6765\u81ea\u7279\u5b9a IP \u5730\u5740\u7684\u8bf7\u6c42\uff0c\u5e76\u6f14\u793a\u5982\u4f55\u4f7f\u7528 NetworkPolicy \u5728 Kubernetes \u4e2d\u5b9e\u73b0\u66f4\u4e25\u683c\u7684\u8bbf\u95ee\u63a7\u5236\u3002","og_url":"https:\/\/www.linuxdevops.cn\/2022\/08\/nginx-ingress-shields-an-interface-and-restricts-ip\/","og_site_name":"Linux\u81ea\u52a8\u5316\u8fd0\u7ef4","article_published_time":"2022-08-19T07:47:27+00:00","article_modified_time":"2023-04-07T01:53:16+00:00","author":"\u7ba1\u7406\u5458","twitter_card":"summary_large_image","schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.linuxdevops.cn\/2022\/08\/nginx-ingress-shields-an-interface-and-restricts-ip\/#article","isPartOf":{"@id":"https:\/\/www.linuxdevops.cn\/2022\/08\/nginx-ingress-shields-an-interface-and-restricts-ip\/"},"author":{"name":"\u7ba1\u7406\u5458","@id":"https:\/\/www.linuxdevops.cn\/#\/schema\/person\/3e206335d5796fdd8679e449df72a0d1"},"headline":"NGINX ingress \u5c4f\u853d\u67d0\u4e2a\u63a5\u53e3\uff0c\u9488\u5bf9\u67d0\u4e2a\u63a5\u53e3\u8fdb\u884cIP\u767d\u540d\u5355\u8bbf\u95ee\u9650\u5236","datePublished":"2022-08-19T07:47:27+00:00","dateModified":"2023-04-07T01:53:16+00:00","mainEntityOfPage":{"@id":"https:\/\/www.linuxdevops.cn\/2022\/08\/nginx-ingress-shields-an-interface-and-restricts-ip\/"},"wordCount":23,"commentCount":0,"publisher":{"@id":"https:\/\/www.linuxdevops.cn\/#\/schema\/person\/3e206335d5796fdd8679e449df72a0d1"},"keywords":["ip\u767d\u540d\u5355","NGINX","nginx ingress","\u63a5\u53e3IP\u767d\u540d\u5355"],"articleSection":["Kubernetes"],"inLanguage":"zh-CN","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.linuxdevops.cn\/2022\/08\/nginx-ingress-shields-an-interface-and-restricts-ip\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.linuxdevops.cn\/2022\/08\/nginx-ingress-shields-an-interface-and-restricts-ip\/","url":"https:\/\/www.linuxdevops.cn\/2022\/08\/nginx-ingress-shields-an-interface-and-restricts-ip\/","name":"NGINX ingress \u5c4f\u853d\u67d0\u4e2a\u63a5\u53e3\uff0c\u9488\u5bf9\u67d0\u4e2a\u63a5\u53e3\u8fdb\u884cIP\u767d\u540d\u5355\u8bbf\u95ee\u9650\u5236 - Linux\u81ea\u52a8\u5316\u8fd0\u7ef4","isPartOf":{"@id":"https:\/\/www.linuxdevops.cn\/#website"},"datePublished":"2022-08-19T07:47:27+00:00","dateModified":"2023-04-07T01:53:16+00:00","description":"\u672c\u6587\u4ecb\u7ecd\u4e86\u5982\u4f55\u4f7f\u7528 Nginx Ingress \u63a7\u5236\u548c\u9650\u5236\u8bbf\u95ee\u60a8\u7684 Kubernetes \u96c6\u7fa4\u4e2d\u7684\u670d\u52a1\u63a5\u53e3\u3002\u6211\u4eec\u5c06\u63a2\u8ba8\u5982\u4f55\u8bbe\u7f6e Nginx Ingress \u4ee5\u5141\u8bb8\u6216\u62d2\u7edd\u6765\u81ea\u7279\u5b9a IP \u5730\u5740\u7684\u8bf7\u6c42\uff0c\u5e76\u6f14\u793a\u5982\u4f55\u4f7f\u7528 NetworkPolicy \u5728 Kubernetes \u4e2d\u5b9e\u73b0\u66f4\u4e25\u683c\u7684\u8bbf\u95ee\u63a7\u5236\u3002","breadcrumb":{"@id":"https:\/\/www.linuxdevops.cn\/2022\/08\/nginx-ingress-shields-an-interface-and-restricts-ip\/#breadcrumb"},"inLanguage":"zh-CN","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.linuxdevops.cn\/2022\/08\/nginx-ingress-shields-an-interface-and-restricts-ip\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.linuxdevops.cn\/2022\/08\/nginx-ingress-shields-an-interface-and-restricts-ip\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u9996\u9875","item":"https:\/\/www.linuxdevops.cn\/"},{"@type":"ListItem","position":2,"name":"kubernetes","item":"https:\/\/www.linuxdevops.cn\/kubernetes\/"},{"@type":"ListItem","position":3,"name":"NGINX ingress \u5c4f\u853d\u67d0\u4e2a\u63a5\u53e3\uff0c\u9488\u5bf9\u67d0\u4e2a\u63a5\u53e3\u8fdb\u884cIP\u767d\u540d\u5355\u8bbf\u95ee\u9650\u5236"}]},{"@type":"WebSite","@id":"https:\/\/www.linuxdevops.cn\/#website","url":"https:\/\/www.linuxdevops.cn\/","name":"Linux\u81ea\u52a8\u5316\u8fd0\u7ef4","description":"Linux\u81ea\u52a8\u5316\u8fd0\u7ef4\u7b14\u8bb0","publisher":{"@id":"https:\/\/www.linuxdevops.cn\/#\/schema\/person\/3e206335d5796fdd8679e449df72a0d1"},"alternateName":"linuxdevops","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.linuxdevops.cn\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"zh-CN"},{"@type":["Person","Organization"],"@id":"https:\/\/www.linuxdevops.cn\/#\/schema\/person\/3e206335d5796fdd8679e449df72a0d1","name":"\u7ba1\u7406\u5458","image":{"@type":"ImageObject","inLanguage":"zh-CN","@id":"https:\/\/www.linuxdevops.cn\/#\/schema\/person\/image\/","url":"https:\/\/www.linuxdevops.cn\/wp-content\/uploads\/2019\/07\/cropped-index.jpg","contentUrl":"https:\/\/www.linuxdevops.cn\/wp-content\/uploads\/2019\/07\/cropped-index.jpg","width":512,"height":512,"caption":"\u7ba1\u7406\u5458"},"logo":{"@id":"https:\/\/www.linuxdevops.cn\/#\/schema\/person\/image\/"},"description":"\u7ba1\u7406\u5458","url":"https:\/\/www.linuxdevops.cn\/author\/root\/"}]}},"_links":{"self":[{"href":"https:\/\/www.linuxdevops.cn\/wp-json\/wp\/v2\/posts\/1180"}],"collection":[{"href":"https:\/\/www.linuxdevops.cn\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.linuxdevops.cn\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.linuxdevops.cn\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.linuxdevops.cn\/wp-json\/wp\/v2\/comments?post=1180"}],"version-history":[{"count":1,"href":"https:\/\/www.linuxdevops.cn\/wp-json\/wp\/v2\/posts\/1180\/revisions"}],"predecessor-version":[{"id":1182,"href":"https:\/\/www.linuxdevops.cn\/wp-json\/wp\/v2\/posts\/1180\/revisions\/1182"}],"wp:attachment":[{"href":"https:\/\/www.linuxdevops.cn\/wp-json\/wp\/v2\/media?parent=1180"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.linuxdevops.cn\/wp-json\/wp\/v2\/categories?post=1180"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.linuxdevops.cn\/wp-json\/wp\/v2\/tags?post=1180"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}