{"id":49864,"date":"2024-10-08T08:08:13","date_gmt":"2024-10-08T00:08:13","guid":{"rendered":"https:\/\/server.hk\/cnblog\/49864\/"},"modified":"2024-10-08T08:08:13","modified_gmt":"2024-10-08T00:08:13","slug":"nginx-%e6%8a%80%e5%b7%a7%ef%bc%9a%e4%bd%bf%e7%94%a8-proxy_temp_path-%e6%8c%87%e4%bb%a4%e9%80%b2%e8%a1%8c%e8%87%a8%e6%99%82%e6%96%87%e4%bb%b6%e5%ad%98%e5%84%b2","status":"publish","type":"post","link":"https:\/\/server.hk\/cnblog\/49864\/","title":{"rendered":"Nginx \u6280\u5de7\uff1a\u4f7f\u7528 proxy_temp_path \u6307\u4ee4\u9032\u884c\u81e8\u6642\u6587\u4ef6\u5b58\u5132"},"content":{"rendered":"<h1 id=\"nginx-%e6%8a%80%e5%b7%a7%ef%bc%9a%e4%bd%bf%e7%94%a8-proxy_temp_path-%e6%8c%87%e4%bb%a4%e9%80%b2%e8%a1%8c%e8%87%a8%e6%99%82%e6%96%87%e4%bb%b6%e5%ad%98%e5%84%b2-GRTcIUAFsf\">Nginx \u6280\u5de7\uff1a\u4f7f\u7528 proxy_temp_path \u6307\u4ee4\u9032\u884c\u81e8\u6642\u6587\u4ef6\u5b58\u5132<\/h1>\n<p>Nginx \u662f\u4e00\u6b3e\u9ad8\u6548\u80fd\u7684\u7db2\u9801\u4f3a\u670d\u5668\uff0c\u5ee3\u6cdb\u61c9\u7528\u65bc\u53cd\u5411\u4ee3\u7406\u3001\u8ca0\u8f09\u5747\u8861\u53caHTTP\u5feb\u53d6\u7b49\u5834\u666f\u3002\u5728\u4f7f\u7528 Nginx \u4f5c\u70ba\u53cd\u5411\u4ee3\u7406\u4f3a\u670d\u5668\u6642\uff0c\u53ef\u80fd\u6703\u9700\u8981\u8655\u7406\u5927\u91cf\u7684\u81e8\u6642\u6587\u4ef6\u3002\u9019\u6642\uff0c<code>proxy_temp_path<\/code> \u6307\u4ee4\u4fbf\u6210\u70ba\u4e86\u4e00\u500b\u91cd\u8981\u7684\u5de5\u5177\uff0c\u80fd\u5920\u5e6b\u52a9\u7ba1\u7406\u9019\u4e9b\u81e8\u6642\u6587\u4ef6\u7684\u5b58\u5132\u4f4d\u7f6e\u3002<\/p>\n<h2 id=\"%e4%bb%80%e9%ba%bc%e6%98%af-proxy_temp_path%ef%bc%9f-GRTcIUAFsf\">\u4ec0\u9ebc\u662f proxy_temp_path\uff1f<\/h2>\n<p><code>proxy_temp_path<\/code> \u6307\u4ee4\u7528\u65bc\u6307\u5b9a Nginx \u5728\u8655\u7406\u53cd\u5411\u4ee3\u7406\u8acb\u6c42\u6642\uff0c\u81e8\u6642\u6587\u4ef6\u7684\u5b58\u5132\u8def\u5f91\u3002\u7576 Nginx \u9700\u8981\u5f9e\u4e0a\u6e38\u4f3a\u670d\u5668\u7372\u53d6\u6578\u64da\u4e26\u5c07\u5176\u50b3\u905e\u7d66\u5ba2\u6236\u7aef\u6642\uff0c\u9019\u4e9b\u6578\u64da\u53ef\u80fd\u6703\u88ab\u66ab\u6642\u5b58\u5132\u5728\u78c1\u789f\u4e0a\uff0c\u4ee5\u4fbf\u5f8c\u7e8c\u7684\u8655\u7406\u548c\u50b3\u8f38\u3002<\/p>\n<h2 id=\"%e7%82%ba%e4%bb%80%e9%ba%bc%e9%9c%80%e8%a6%81-proxy_temp_path%ef%bc%9f-GRTcIUAFsf\">\u70ba\u4ec0\u9ebc\u9700\u8981 proxy_temp_path\uff1f<\/h2>\n<p>\u5728\u67d0\u4e9b\u60c5\u6cc1\u4e0b\uff0c\u5f9e\u4e0a\u6e38\u4f3a\u670d\u5668\u7372\u53d6\u7684\u6578\u64da\u53ef\u80fd\u6703\u975e\u5e38\u5927\uff0c\u8d85\u904e\u4e86 Nginx \u7684\u7de9\u5b58\u5927\u5c0f\u9650\u5236\u3002\u9019\u6642\uff0c<code>proxy_temp_path<\/code> \u6307\u4ee4\u53ef\u4ee5\u5e6b\u52a9\u5c07\u9019\u4e9b\u6578\u64da\u5b58\u5132\u5230\u6307\u5b9a\u7684\u81e8\u6642\u8def\u5f91\u4e2d\uff0c\u5f9e\u800c\u907f\u514d\u56e0\u70ba\u5167\u5b58\u4e0d\u8db3\u800c\u5c0e\u81f4\u7684\u8acb\u6c42\u5931\u6557\u3002<\/p>\n<h2 id=\"%e5%a6%82%e4%bd%95%e9%85%8d%e7%bd%ae-proxy_temp_path%ef%bc%9f-GRTcIUAFsf\">\u5982\u4f55\u914d\u7f6e proxy_temp_path\uff1f<\/h2>\n<p>\u8981\u4f7f\u7528 <code>proxy_temp_path<\/code> \u6307\u4ee4\uff0c\u60a8\u9700\u8981\u5728 Nginx \u7684\u914d\u7f6e\u6587\u4ef6\u4e2d\u9032\u884c\u76f8\u61c9\u7684\u8a2d\u7f6e\u3002\u4ee5\u4e0b\u662f\u4e00\u500b\u57fa\u672c\u7684\u914d\u7f6e\u793a\u4f8b\uff1a<\/p>\n<pre><code>http {\n    proxy_temp_path \/var\/tmp\/nginx_temp;\n    \n    server {\n        listen 80;\n        server_name example.com;\n\n        location \/ {\n            proxy_pass http:\/\/upstream_server;\n            proxy_temp_file_write_size 64k;\n        }\n    }\n}<\/code><\/pre>\n<p>\u5728\u9019\u500b\u793a\u4f8b\u4e2d\uff0c<code>proxy_temp_path<\/code> \u6307\u4ee4\u5c07\u81e8\u6642\u6587\u4ef6\u5b58\u5132\u5728 <code>\/var\/tmp\/nginx_temp<\/code> \u76ee\u9304\u4e2d\u3002\u60a8\u53ef\u4ee5\u6839\u64da\u5be6\u969b\u9700\u6c42\u8abf\u6574\u9019\u500b\u8def\u5f91\u3002<\/p>\n<h2 id=\"%e6%b3%a8%e6%84%8f%e4%ba%8b%e9%a0%85-GRTcIUAFsf\">\u6ce8\u610f\u4e8b\u9805<\/h2>\n<ul>\n<li><strong>\u6b0a\u9650\u8a2d\u7f6e\uff1a<\/strong>\u78ba\u4fdd Nginx \u7528\u6236\u5c0d\u6307\u5b9a\u7684\u81e8\u6642\u8def\u5f91\u64c1\u6709\u5beb\u5165\u6b0a\u9650\u3002<\/li>\n<li><strong>\u6e05\u7406\u81e8\u6642\u6587\u4ef6\uff1a<\/strong>\u5b9a\u671f\u6aa2\u67e5\u548c\u6e05\u7406\u81e8\u6642\u6587\u4ef6\uff0c\u4ee5\u907f\u514d\u78c1\u789f\u7a7a\u9593\u4e0d\u8db3\u3002<\/li>\n<li><strong>\u6027\u80fd\u8003\u91cf\uff1a<\/strong>\u9078\u64c7\u5feb\u901f\u7684\u78c1\u789f\u5b58\u5132\uff0c\u4ee5\u63d0\u9ad8\u6578\u64da\u7684\u8b80\u53d6\u548c\u5beb\u5165\u901f\u5ea6\u3002<\/li>\n<\/ul>\n<h2 id=\"%e7%b5%90%e8%ab%96-GRTcIUAFsf\">\u7d50\u8ad6<\/h2>\n<p>\u4f7f\u7528 <code>proxy_temp_path<\/code> \u6307\u4ee4\u53ef\u4ee5\u6709\u6548\u5730\u7ba1\u7406 Nginx \u5728\u8655\u7406\u53cd\u5411\u4ee3\u7406\u8acb\u6c42\u6642\u7684\u81e8\u6642\u6587\u4ef6\u5b58\u5132\u3002\u901a\u904e\u5408\u7406\u914d\u7f6e\uff0c\u60a8\u53ef\u4ee5\u63d0\u9ad8\u4f3a\u670d\u5668\u7684\u7a69\u5b9a\u6027\u548c\u6027\u80fd\uff0c\u78ba\u4fdd\u7528\u6236\u7372\u5f97\u66f4\u597d\u7684\u9ad4\u9a57\u3002\u5c0d\u65bc\u9700\u8981\u9ad8\u6548\u80fd\u7684\u7db2\u7ad9\u6216\u61c9\u7528\uff0c\u9019\u662f\u4e00\u500b\u4e0d\u53ef\u6216\u7f3a\u7684\u6280\u5de7\u3002<\/p>\n<p>\u5982\u679c\u60a8\u6b63\u5728\u5c0b\u627e\u9ad8\u6548\u7684 <a href=\"https:\/\/server.hk\">\u9999\u6e2fVPS<\/a> \u89e3\u6c7a\u65b9\u6848\uff0cServer.HK \u63d0\u4f9b\u591a\u7a2e\u9078\u64c7\uff0c\u6eff\u8db3\u4e0d\u540c\u9700\u6c42\u7684\u5ba2\u6236\u3002\u7121\u8ad6\u662f\u7db2\u7ad9\u6258\u7ba1\u9084\u662f\u61c9\u7528\u90e8\u7f72\uff0c\u6211\u5011\u7684 <a href=\"https:\/\/server.hk\">\u4f3a\u670d\u5668<\/a> \u90fd\u80fd\u70ba\u60a8\u63d0\u4f9b\u7a69\u5b9a\u7684\u652f\u6301\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u63a2\u7d22 Nginx \u7684 proxy_temp_path \u6307\u4ee4\uff0c\u5b78\u7fd2\u5982\u4f55\u6709\u6548\u7ba1\u7406\u81e8\u6642\u6587\u4ef6\u5b58\u5132\uff0c\u63d0\u5347\u4f3a\u670d\u5668\u6027\u80fd\u8207\u6548\u7387\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-49864","post","type-post","status-publish","format-standard","hentry","category-setup-tutorials"],"_links":{"self":[{"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts\/49864","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=49864"}],"version-history":[{"count":1,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts\/49864\/revisions"}],"predecessor-version":[{"id":49865,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts\/49864\/revisions\/49865"}],"wp:attachment":[{"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/media?parent=49864"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/categories?post=49864"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/tags?post=49864"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}