{"id":1788,"date":"2025-08-05T01:28:50","date_gmt":"2025-08-04T17:28:50","guid":{"rendered":"https:\/\/www.hgfwq.com\/blog\/?p=1788"},"modified":"2025-08-05T01:28:50","modified_gmt":"2025-08-04T17:28:50","slug":"400%e9%94%99%e8%af%af%e6%9c%89%e5%93%aa%e4%ba%9b%e5%b8%b8%e8%a7%81%e5%8e%9f%e5%9b%a0%e5%af%bc%e8%87%b4%e5%ae%a2%e6%88%b7%e7%ab%af%e8%af%b7%e6%b1%82%e5%a4%b1%e8%b4%a5","status":"publish","type":"post","link":"https:\/\/www.hgfwq.com\/blog\/1788.html","title":{"rendered":"400\u9519\u8bef\u6709\u54ea\u4e9b\u5e38\u89c1\u539f\u56e0\u5bfc\u81f4\u5ba2\u6237\u7aef\u8bf7\u6c42\u5931\u8d25"},"content":{"rendered":"<p><p>\u5728\u5904\u7406Web\u670d\u52a1\u65f6\uff0c\u7ecf\u5e38\u4f1a\u9047\u5230HTTP 400\u9519\u8bef\uff0c\u8fd9\u901a\u5e38\u610f\u5473\u7740\u5ba2\u6237\u7aef\u8bf7\u6c42\u6709\u8bef\u3002\u672c\u6587\u5c06\u63d0\u4f9b\u4e00\u4e2a\u5b9e\u64cd\u5bfc\u5411\u7684\u6307\u5357\uff0c\u5e2e\u52a9\u60a8\u89e3\u51b3HTTP 400\u9519\u8bef\u7684\u95ee\u9898\u3002<\/p>\n<p style=\"text-align:center\"><img decoding=\"async\" src=\"https:\/\/www.hgfwq.com\/blog\/wp-content\/uploads\/2025\/07\/g65t86GA3.jpg\" alt=\"400\u9519\u8bef\u6709\u54ea\u4e9b\u5e38\u89c1\u539f\u56e0\u5bfc\u81f4\u5ba2\u6237\u7aef\u8bf7\u6c42\u5931\u8d25\" title=\"400\u9519\u8bef\u6709\u54ea\u4e9b\u5e38\u89c1\u539f\u56e0\u5bfc\u81f4\u5ba2\u6237\u7aef\u8bf7\u6c42\u5931\u8d25\"><\/p>\n<\/p>\n<p><h2>\u4efb\u52a1\uff1a\u89e3\u51b3HTTP 400\u9519\u8bef<\/h2>\n<\/p>\n<p><p>\u672c\u6587\u65e8\u5728\u5e2e\u52a9\u60a8\u8bc6\u522b\u548c\u89e3\u51b3\u7531HTTP 400\u9519\u8bef\u5f15\u8d77\u7684Web\u670d\u52a1\u95ee\u9898\u3002<\/p>\n<\/p>\n<p><h2>\u64cd\u4f5c\u524d\u7684\u51c6\u5907\u6216\u80cc\u666f\u4ecb\u7ecd<\/h2>\n<\/p>\n<p><p>\u5728\u5f00\u59cb\u64cd\u4f5c\u4e4b\u524d\uff0c\u8bf7\u786e\u4fdd\u60a8\u6709\u4ee5\u4e0b\u4fe1\u606f\uff1a<\/p>\n<\/p>\n<ul>\n<li>Web\u670d\u52a1\u5668\u7684\u7c7b\u578b\uff08\u4f8b\u5982\uff1aApache, Nginx\uff09<\/li>\n<li>Web\u670d\u52a1\u5668\u7684\u914d\u7f6e\u6587\u4ef6\u8def\u5f84\uff08\u4f8b\u5982\uff1aApache\u7684httpd.conf\uff09<\/li>\n<li>\u8bbf\u95eeWeb\u670d\u52a1\u7684URL<\/li>\n<\/ul>\n<p><h2>\u8be6\u7ec6\u64cd\u4f5c\u6b65\u9aa4<\/h2>\n<\/p>\n<p><h3>\u6b65\u9aa41\uff1a\u68c0\u67e5\u8bf7\u6c42\u5185\u5bb9<\/h3>\n<\/p>\n<p><p>\u9996\u5148\uff0c\u786e\u8ba4\u5ba2\u6237\u7aef\u53d1\u9001\u7684\u8bf7\u6c42\u5185\u5bb9\u662f\u5426\u6b63\u786e\u3002<\/p>\n<\/p>\n<p><pre><code>curl -X GET \"http:\/\/yourdomain.com\"<\/p>\r\n<p><\/code><\/pre>\n<\/p>\n<p><h3>\u6b65\u9aa42\uff1a\u68c0\u67e5\u670d\u52a1\u5668\u914d\u7f6e<\/h3>\n<\/p>\n<p><p>\u68c0\u67e5Web\u670d\u52a1\u5668\u7684\u914d\u7f6e\u6587\u4ef6\uff0c\u786e\u4fdd\u6ca1\u6709\u914d\u7f6e\u9519\u8bef\u3002<\/p>\n<\/p>\n<p><h4>Apache\u670d\u52a1\u5668<\/h4>\n<\/p>\n<p><pre><code>sudo nano \/etc\/apache2\/httpd.conf<\/p>\r\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u67e5\u627e\u5e76\u68c0\u67e5\u4ee5\u4e0b\u914d\u7f6e\u9879\uff1a<\/p>\n<\/p>\n<ul>\n<li>ServerRoot \u6307\u4ee4\u662f\u5426\u6b63\u786e<\/li>\n<li>DocumentRoot \u6307\u4ee4\u662f\u5426\u6307\u5411\u6b63\u786e\u7684\u76ee\u5f55<\/li>\n<li>DirectoryIndex \u6307\u4ee4\u662f\u5426\u6b63\u786e<\/li>\n<\/ul>\n<p><h4>Nginx\u670d\u52a1\u5668<\/h4>\n<\/p>\n<p><pre><code>sudo nano \/etc\/nginx\/nginx.conf<\/p>\r\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u67e5\u627e\u5e76\u68c0\u67e5\u4ee5\u4e0b\u914d\u7f6e\u9879\uff1a<\/p>\n<\/p>\n<ul>\n<li>server { &#8230; } \u5757\u4e2d\u7684server_name\u6307\u4ee4\u662f\u5426\u6b63\u786e<\/li>\n<li>location { &#8230; } \u5757\u4e2d\u7684root\u6307\u4ee4\u662f\u5426\u6307\u5411\u6b63\u786e\u7684\u76ee\u5f55<\/li>\n<\/ul>\n<p><h3>\u6b65\u9aa43\uff1a\u68c0\u67e5URL\u7f16\u7801<\/h3>\n<\/p>\n<p><p>\u786e\u4fddURL\u4e2d\u5305\u542b\u7684\u53c2\u6570\u88ab\u6b63\u786e\u7f16\u7801\u3002<\/p>\n<\/p>\n<p><pre><code>curl -X GET \"http:\/\/yourdomain.com?param1=value1&param2=value2\"<\/p>\r\n<p><\/code><\/pre>\n<\/p>\n<p><h3>\u6b65\u9aa44\uff1a\u68c0\u67e5\u5ba2\u6237\u7aef\u4ee3\u7801<\/h3>\n<\/p>\n<p><p>\u5982\u679c\u5ba2\u6237\u7aef\u4ee3\u7801\u662f\u81ea\u5b9a\u4e49\u7684\uff0c\u68c0\u67e5\u662f\u5426\u6709\u8bed\u6cd5\u9519\u8bef\u6216\u903b\u8f91\u9519\u8bef\u3002<\/p>\n<\/p>\n<p><h2>\u6d89\u53ca\u7684\u5173\u952e\u547d\u4ee4\u3001\u4ee3\u7801\u6216\u914d\u7f6e\u793a\u4f8b<\/h2>\n<\/p>\n<p><h3>Apache\u670d\u52a1\u5668<\/h3>\n<\/p>\n<p><pre><code>ServerRoot \"\/etc\/apache2\"<\/p>\r\n<p>DocumentRoot \"\/var\/www\/html\"<\/p>\r\n<p>DirectoryIndex index.html index.htm<\/p>\r\n<p><\/code><\/pre>\n<\/p>\n<p><h3>Nginx\u670d\u52a1\u5668<\/h3>\n<\/p>\n<p><pre><code>server {<\/p>\r\n<p>    server_name yourdomain.com;<\/p>\r\n<p>    root \/var\/www\/html;<\/p>\r\n<p>    location \/ {<\/p>\r\n<p>        index index.html index.htm;<\/p>\r\n<p>    }<\/p>\r\n<p>}<\/p>\r\n<p><\/code><\/pre>\n<\/p>\n<p><h2>\u5bf9\u547d\u4ee4\u3001\u4ee3\u7801\u6216\u91cd\u8981\u6982\u5ff5\u7684\u6e05\u6670\u89e3\u91ca<\/h2>\n<\/p>\n<p><p><strong>curl<\/strong>\uff1a\u4e00\u4e2a\u7528\u4e8e\u4f20\u8f93\u6587\u4ef6\u7684\u547d\u4ee4\u884c\u5de5\u5177\uff0c\u652f\u6301\u591a\u79cd\u534f\u8bae\u3002<\/p>\n<\/p>\n<p><p><strong>ServerRoot<\/strong>\uff1aApache\u670d\u52a1\u5668\u7684\u6839\u76ee\u5f55\u3002<\/p>\n<\/p>\n<p><p><strong>DocumentRoot<\/strong>\uff1aWeb\u670d\u52a1\u5668\u7684\u6587\u6863\u6839\u76ee\u5f55\uff0c\u5373\u5b58\u653e\u7f51\u7ad9\u6587\u4ef6\u7684\u76ee\u5f55\u3002<\/p>\n<\/p>\n<p><p><strong>DirectoryIndex<\/strong>\uff1a\u6307\u5b9aWeb\u670d\u52a1\u5668\u5728\u76ee\u5f55\u4e0b\u641c\u7d22\u7684\u9ed8\u8ba4\u6587\u4ef6\u540d\u3002<\/p>\n<\/p>\n<p><h2>\u64cd\u4f5c\u8fc7\u7a0b\u4e2d\u53ef\u80fd\u9047\u5230\u7684\u95ee\u9898\u3001\u6ce8\u610f\u4e8b\u9879\u6216\u76f8\u5173\u7684\u5b9e\u7528\u6280\u5de7<\/h2>\n<\/p>\n<ul>\n<li>\u786e\u4fddWeb\u670d\u52a1\u5668\u5df2\u7ecf\u542f\u52a8\u5e76\u8fd0\u884c\u3002<\/li>\n<li>\u68c0\u67e5Web\u670d\u52a1\u5668\u7684\u9519\u8bef\u65e5\u5fd7\uff0c\u4ee5\u83b7\u53d6\u66f4\u8be6\u7ec6\u7684\u9519\u8bef\u4fe1\u606f\u3002<\/li>\n<li>\u4f7f\u7528\u5f00\u53d1\u8005\u5de5\u5177\u68c0\u67e5\u6d4f\u89c8\u5668\u53d1\u9001\u7684\u8bf7\u6c42\u3002<\/li>\n<\/ul>\n<p>&#8220;`<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u5728\u5904\u7406Web\u670d\u52a1\u65f6\uff0c\u7ecf\u5e38\u4f1a\u9047\u5230HTTP 400\u9519\u8bef\uff0c\u8fd9\u901a\u5e38\u610f\u5473\u7740\u5ba2\u6237\u7aef\u8bf7\u6c42\u6709\u8bef\u3002\u672c\u6587\u5c06\u63d0\u4f9b\u4e00\u4e2a\u5b9e\u64cd\u5bfc\u5411\u7684\u6307\u5357\uff0c\u5e2e\u52a9\u60a8\u89e3\u51b3HTTP 400\u9519\u8bef\u7684\u95ee\u9898\u3002 \u4efb\u52a1\uff1a\u89e3\u51b3HTTP 400\u9519\u8bef \u672c\u6587\u65e8\u5728\u5e2e\u52a9\u60a8\u8bc6\u522b\u548c\u89e3\u51b3\u7531HTTP 400\u9519\u8bef\u5f15\u8d77\u7684Web&#8230;<\/p>\n","protected":false},"author":1,"featured_media":1789,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[199,198],"topic":[],"class_list":["post-1788","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-haiwai","tag-http","tag-web"],"_links":{"self":[{"href":"https:\/\/www.hgfwq.com\/blog\/wp-json\/wp\/v2\/posts\/1788","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.hgfwq.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.hgfwq.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.hgfwq.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.hgfwq.com\/blog\/wp-json\/wp\/v2\/comments?post=1788"}],"version-history":[{"count":1,"href":"https:\/\/www.hgfwq.com\/blog\/wp-json\/wp\/v2\/posts\/1788\/revisions"}],"predecessor-version":[{"id":1791,"href":"https:\/\/www.hgfwq.com\/blog\/wp-json\/wp\/v2\/posts\/1788\/revisions\/1791"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.hgfwq.com\/blog\/wp-json\/wp\/v2\/media\/1789"}],"wp:attachment":[{"href":"https:\/\/www.hgfwq.com\/blog\/wp-json\/wp\/v2\/media?parent=1788"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.hgfwq.com\/blog\/wp-json\/wp\/v2\/categories?post=1788"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.hgfwq.com\/blog\/wp-json\/wp\/v2\/tags?post=1788"},{"taxonomy":"topic","embeddable":true,"href":"https:\/\/www.hgfwq.com\/blog\/wp-json\/wp\/v2\/topic?post=1788"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}