{"id":49306,"date":"2024-10-08T03:49:15","date_gmt":"2024-10-07T19:49:15","guid":{"rendered":"https:\/\/server.hk\/cnblog\/49306\/"},"modified":"2024-10-08T03:49:15","modified_gmt":"2024-10-07T19:49:15","slug":"content-location-%e6%96%87%e4%bb%b6%e9%a0%ad%e5%ae%9a%e7%be%a9%e6%96%b9%e6%b3%95%ef%bc%88%e9%98%b2%e6%ad%a2%e5%85%a7%e9%83%a8-ip-%e5%9c%b0%e5%9d%80%e6%b3%84%e6%bc%8f%e4%ba%8c%e6%b3%95%ef%bc%89","status":"publish","type":"post","link":"https:\/\/server.hk\/cnblog\/49306\/","title":{"rendered":"Content-Location \u6587\u4ef6\u982d\u5b9a\u7fa9\u65b9\u6cd5\uff08\u9632\u6b62\u5167\u90e8 IP \u5730\u5740\u6cc4\u6f0f\u4e8c\u6cd5\uff09"},"content":{"rendered":"<h1 id=\"content-location-%e6%96%87%e4%bb%b6%e9%a0%ad%e5%ae%9a%e7%be%a9%e6%96%b9%e6%b3%95%ef%bc%88%e9%98%b2%e6%ad%a2%e5%85%a7%e9%83%a8-ip-%e5%9c%b0%e5%9d%80%e6%b3%84%e6%bc%8f%e4%ba%8c%e6%b3%95%ef%bc%89-eTJgYmMhUn\">Content-Location \u6587\u4ef6\u982d\u5b9a\u7fa9\u65b9\u6cd5\uff08\u9632\u6b62\u5167\u90e8 IP \u5730\u5740\u6cc4\u6f0f\u4e8c\u6cd5\uff09<\/h1>\n<p>\u5728\u7576\u4eca\u7684\u7db2\u7d61\u74b0\u5883\u4e2d\uff0c\u4fdd\u8b77\u7528\u6236\u7684\u96b1\u79c1\u548c\u6578\u64da\u5b89\u5168\u8b8a\u5f97\u8d8a\u4f86\u8d8a\u91cd\u8981\u3002\u5c24\u5176\u662f\u5728\u8655\u7406\u654f\u611f\u4fe1\u606f\u6642\uff0c\u5167\u90e8 IP \u5730\u5740\u7684\u6cc4\u6f0f\u53ef\u80fd\u6703\u5c0e\u81f4\u56b4\u91cd\u7684\u5b89\u5168\u554f\u984c\u3002\u70ba\u4e86\u9632\u6b62\u9019\u7a2e\u60c5\u6cc1\u7684\u767c\u751f\uff0cContent-Location \u6587\u4ef6\u982d\u7684\u6b63\u78ba\u4f7f\u7528\u986f\u5f97\u5c24\u70ba\u91cd\u8981\u3002\u672c\u6587\u5c07\u63a2\u8a0e Content-Location \u6587\u4ef6\u982d\u7684\u5b9a\u7fa9\u65b9\u6cd5\u53ca\u5176\u5728\u9632\u6b62\u5167\u90e8 IP \u5730\u5740\u6cc4\u6f0f\u65b9\u9762\u7684\u61c9\u7528\u3002<\/p>\n<h2 id=\"%e4%bb%80%e9%ba%bc%e6%98%af-content-location-%e6%96%87%e4%bb%b6%e9%a0%ad%ef%bc%9f-eTJgYmMhUn\">\u4ec0\u9ebc\u662f Content-Location \u6587\u4ef6\u982d\uff1f<\/h2>\n<p>Content-Location \u662f\u4e00\u500b HTTP \u97ff\u61c9\u982d\uff0c\u7528\u65bc\u6307\u793a\u8cc7\u6e90\u7684\u539f\u59cb\u4f4d\u7f6e\u3002\u9019\u500b\u982d\u90e8\u901a\u5e38\u7528\u65bc\u63d0\u4f9b\u8cc7\u6e90\u7684 URI\uff0c\u7279\u5225\u662f\u5728\u8cc7\u6e90\u7684\u5167\u5bb9\u8207\u5176\u4f4d\u7f6e\u4e0d\u4e00\u81f4\u7684\u60c5\u6cc1\u4e0b\u3002\u9019\u610f\u5473\u8457\uff0c\u7576\u7528\u6236\u8acb\u6c42\u67d0\u500b\u8cc7\u6e90\u6642\uff0cContent-Location \u53ef\u4ee5\u544a\u8a34\u7528\u6236\u8a72\u8cc7\u6e90\u7684\u6b63\u78ba\u4f4d\u7f6e\u3002<\/p>\n<h2 id=\"%e7%82%ba%e4%bb%80%e9%ba%bc%e9%9c%80%e8%a6%81%e9%98%b2%e6%ad%a2%e5%85%a7%e9%83%a8-ip-%e5%9c%b0%e5%9d%80%e6%b3%84%e6%bc%8f%ef%bc%9f-eTJgYmMhUn\">\u70ba\u4ec0\u9ebc\u9700\u8981\u9632\u6b62\u5167\u90e8 IP \u5730\u5740\u6cc4\u6f0f\uff1f<\/h2>\n<p>\u5167\u90e8 IP \u5730\u5740\u6cc4\u6f0f\u53ef\u80fd\u6703\u5c0e\u81f4\u591a\u7a2e\u5b89\u5168\u98a8\u96aa\uff0c\u5305\u62ec\u4f46\u4e0d\u9650\u65bc\uff1a<\/p>\n<ul>\n<li>\u672a\u7d93\u6388\u6b0a\u7684\u8a2a\u554f\uff1a\u653b\u64ca\u8005\u53ef\u4ee5\u5229\u7528\u5167\u90e8 IP \u5730\u5740\u4f86\u9032\u884c\u91dd\u5c0d\u6027\u7684\u653b\u64ca\u3002<\/li>\n<li>\u6578\u64da\u6d29\u6f0f\uff1a\u5167\u90e8\u7db2\u7d61\u7684\u7d50\u69cb\u548c\u8a2d\u5099\u4fe1\u606f\u53ef\u80fd\u88ab\u66b4\u9732\uff0c\u589e\u52a0\u4e86\u6578\u64da\u6d29\u6f0f\u7684\u98a8\u96aa\u3002<\/li>\n<li>\u5408\u898f\u6027\u554f\u984c\uff1a\u67d0\u4e9b\u884c\u696d\u5c0d\u6578\u64da\u4fdd\u8b77\u6709\u56b4\u683c\u7684\u8981\u6c42\uff0c\u5167\u90e8 IP \u5730\u5740\u7684\u6cc4\u6f0f\u53ef\u80fd\u6703\u5c0e\u81f4\u5408\u898f\u6027\u554f\u984c\u3002<\/li>\n<\/ul>\n<h2 id=\"%e9%98%b2%e6%ad%a2%e5%85%a7%e9%83%a8-ip-%e5%9c%b0%e5%9d%80%e6%b3%84%e6%bc%8f%e7%9a%84%e6%96%b9%e6%b3%95-eTJgYmMhUn\">\u9632\u6b62\u5167\u90e8 IP \u5730\u5740\u6cc4\u6f0f\u7684\u65b9\u6cd5<\/h2>\n<p>\u70ba\u4e86\u6709\u6548\u9632\u6b62\u5167\u90e8 IP \u5730\u5740\u7684\u6cc4\u6f0f\uff0c\u53ef\u4ee5\u63a1\u53d6\u4ee5\u4e0b\u5169\u7a2e\u65b9\u6cd5\uff1a<\/p>\n<h3 id=\"1-%e4%bd%bf%e7%94%a8%e4%bb%a3%e7%90%86%e4%bc%ba%e6%9c%8d%e5%99%a8-eTJgYmMhUn\">1. \u4f7f\u7528\u4ee3\u7406\u4f3a\u670d\u5668<\/h3>\n<p>\u4ee3\u7406\u4f3a\u670d\u5668\u53ef\u4ee5\u4f5c\u70ba\u7528\u6236\u548c\u5167\u90e8\u7db2\u7d61\u4e4b\u9593\u7684\u4e2d\u4ecb\u3002\u7576\u7528\u6236\u8acb\u6c42\u8cc7\u6e90\u6642\uff0c\u8acb\u6c42\u6703\u5148\u767c\u9001\u5230\u4ee3\u7406\u4f3a\u670d\u5668\uff0c\u7136\u5f8c\u7531\u4ee3\u7406\u4f3a\u670d\u5668\u8f49\u767c\u5230\u5167\u90e8\u4f3a\u670d\u5668\u3002\u9019\u6a23\uff0c\u5167\u90e8 IP \u5730\u5740\u5c31\u4e0d\u6703\u76f4\u63a5\u66b4\u9732\u7d66\u7528\u6236\u3002\u4ee5\u4e0b\u662f\u4e00\u500b\u7c21\u55ae\u7684\u4ee3\u7406\u4f3a\u670d\u5668\u914d\u7f6e\u793a\u4f8b\uff1a<\/p>\n<pre><code>server {\n    listen 80;\n    server_name example.com;\n\n    location \/ {\n        proxy_pass http:\/\/internal-server;\n        proxy_set_header Host $host;\n        proxy_set_header X-Real-IP $remote_addr;\n    }\n}<\/code><\/pre>\n<h3 id=\"2-%e4%bd%bf%e7%94%a8-content-location-%e6%96%87%e4%bb%b6%e9%a0%ad-eTJgYmMhUn\">2. \u4f7f\u7528 Content-Location \u6587\u4ef6\u982d<\/h3>\n<p>\u5728 HTTP \u97ff\u61c9\u4e2d\u6b63\u78ba\u4f7f\u7528 Content-Location \u6587\u4ef6\u982d\uff0c\u53ef\u4ee5\u6709\u6548\u5730\u96b1\u85cf\u5167\u90e8 IP \u5730\u5740\u3002\u7576\u8cc7\u6e90\u7684\u5be6\u969b\u4f4d\u7f6e\u8207\u7528\u6236\u8acb\u6c42\u7684 URI \u4e0d\u540c\u6642\uff0c\u53ef\u4ee5\u4f7f\u7528 Content-Location \u4f86\u6307\u5411\u4e00\u500b\u516c\u5171\u7684\u3001\u53ef\u8a2a\u554f\u7684 URI\uff0c\u800c\u4e0d\u662f\u5167\u90e8 IP \u5730\u5740\u3002\u4f8b\u5982\uff1a<\/p>\n<pre><code>HTTP\/1.1 200 OK\nContent-Type: text\/html\nContent-Location: http:\/\/public.example.com\/resource<\/code><\/pre>\n<p>\u9019\u6a23\uff0c\u5373\u4f7f\u7528\u6236\u7372\u53d6\u4e86\u97ff\u61c9\uff0c\u4e5f\u4e0d\u6703\u770b\u5230\u5167\u90e8 IP \u5730\u5740\uff0c\u5f9e\u800c\u964d\u4f4e\u4e86\u6cc4\u6f0f\u7684\u98a8\u96aa\u3002<\/p>\n<h2 id=\"%e7%b5%90%e8%ab%96-eTJgYmMhUn\">\u7d50\u8ad6<\/h2>\n<p>\u5728\u7576\u524d\u7684\u7db2\u7d61\u5b89\u5168\u74b0\u5883\u4e2d\uff0c\u4fdd\u8b77\u5167\u90e8 IP \u5730\u5740\u4e0d\u88ab\u6cc4\u6f0f\u662f\u81f3\u95dc\u91cd\u8981\u7684\u3002\u901a\u904e\u4f7f\u7528\u4ee3\u7406\u4f3a\u670d\u5668\u548c\u6b63\u78ba\u914d\u7f6e Content-Location \u6587\u4ef6\u982d\uff0c\u53ef\u4ee5\u6709\u6548\u5730\u6e1b\u5c11\u5167\u90e8 IP \u5730\u5740\u6cc4\u6f0f\u7684\u98a8\u96aa\u3002\u9019\u4e0d\u50c5\u6709\u52a9\u65bc\u4fdd\u8b77\u7528\u6236\u7684\u96b1\u79c1\uff0c\u9084\u80fd\u63d0\u9ad8\u6574\u9ad4\u7cfb\u7d71\u7684\u5b89\u5168\u6027\u3002<\/p>\n<p>\u5982\u9700\u4e86\u89e3\u66f4\u591a\u6709\u95dc <a href=\"https:\/\/server.hk\">\u9999\u6e2f VPS<\/a> \u53ca\u5176\u5b89\u5168\u914d\u7f6e\u7684\u4fe1\u606f\uff0c\u8acb\u8a2a\u554f\u6211\u5011\u7684\u7db2\u7ad9\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u4e86\u89e3Content-Location\u6587\u4ef6\u982d\u5b9a\u7fa9\u65b9\u6cd5\uff0c\u5b78\u7fd2\u5169\u7a2e\u9632\u6b62\u5167\u90e8IP\u5730\u5740\u6cc4\u6f0f\u7684\u6709\u6548\u7b56\u7565\u3002<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4924],"tags":[],"class_list":["post-49306","post","type-post","status-publish","format-standard","hentry","category-setup-tutorials"],"_links":{"self":[{"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts\/49306","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/comments?post=49306"}],"version-history":[{"count":1,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts\/49306\/revisions"}],"predecessor-version":[{"id":49307,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts\/49306\/revisions\/49307"}],"wp:attachment":[{"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/media?parent=49306"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/categories?post=49306"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/tags?post=49306"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}