{"id":55407,"date":"2020-01-20T00:00:00","date_gmt":"2020-01-19T21:00:00","guid":{"rendered":"https:\/\/prohoster.info\/blog\/blog_prohoster\/nginx-kak-pobedit-response_status-0"},"modified":"2020-02-18T14:03:31","modified_gmt":"2020-02-18T11:03:31","slug":"nginx-kak-pobedit-response_status-0","status":"publish","type":"post","link":"https:\/\/prohoster.info\/en\/blog\/administrirovanie\/nginx-kak-pobedit-response_status-0","title":{"rendered":"[Nginx] \u041a\u0430\u043a \u043f\u043e\u0431\u0435\u0434\u0438\u0442\u044c response_status = 0","gt_translate_keys":[{"key":"rendered","format":"text"}]},"content":{"rendered":"<p>An article in the category of 'notes in the margins'.<\/p>\n<p><b class=\"spoiler_title\">TL:DR:<\/b><\/p>\n<pre><code class=\"nginx\">http2_max_field_size 8k; # will save everyone!<\/code><\/pre>\n<p>On one of the projects, after changing some internal backend logic, I started noticing a strange response_code in the logs, namely \u2014 0. In the logs, it looks something like this:<\/p>\n<pre><code class=\"json\">{\n  \"timestamp\": \"2020-01-17T08:41:51+00:00\",\n  \"remote_addr\": \"zzz.zzz.zzz.zzz\",\n  \"request_time\": 0,\n  \"upstream_response_time\": \"\",\n  \"upstream_header_time\": \"\",\n  \"http_accept_language\": \"-language\",\n  \"response_status\": 0,\n  \"request\": \"\",\n  \"host\": \"example.com\",\n  \"upstream_addr\": \"\",\n  \"http_referrer\": \"\",\n  \"request_length\": 5854,\n  \"bytes_sent\": 0,\n  \"http_user_agent\": \"\"\n}\n<\/code><\/pre>\n<p><noindex><a rel=\"nofollow\" name=\"habracut\"><\/a><\/noindex><br \/>\nReading the documentation and googling on this topic yielded exactly nothing \u2014 since it\u2019s claimed that this behavior occurs when the client closes the connection without sending headers. And various exotic scenarios with buffer size for wsgi_ that didn\u2019t fit our case at all.<\/p>\n<p>Overall, we decided that the problem was not a problem, considering that at our scale, it was completely uncritical.<\/p>\n<p>Right until I was puzzled by the next issue: in some cases, links open perfectly via http, but completely refuse to work over https, giving a wonderful: Connection #0 to host example.com left intact<br \/>\ncurl: (52) Empty reply from server<\/p>\n<p>In the logs, I could only track this by IP \u2014 no request or any other data, as seen from the example above \u2014 is available. Just the notorious status 0, but I know that I didn't interrupt the request! I started digging into what could be going wrong. And it turned out to be very simple:<\/p>\n<p><i>listen 443 <a class=\"wpil_keyword_link\" href=\"https:\/\/prohoster.info\/en\/ssl-sertifikat\/\"   title=\"ssl\" data-wpil-keyword-link=\"linked\"  data-wpil-monitor-id=\"2274\">ssl<\/a> <b>http2<\/b> backlog=8192;<\/i><\/p>\n<p>So here\u2019s the thing \u2014 if you use http2 for ssl connections, it\u2019s not enough just to configure the request buffers, you need to configure them in ngx_http_v2_module as well, namely:<\/p>\n<pre><code class=\"plaintext\">Syntax:\thttp2_max_field_size size;\nDefault:\thttp2_max_field_size 4k;\nContext:\thttp, server\n<\/code><\/pre>\n<p>\n<i>Limits the maximum size of the request header compressed with HPACK. The limit applies equally to both the name and the value. If Huffman encoding is applied, the actual size of the unpacked name and value strings may be larger. The default limit works for most requests.<\/i><\/p>\n<p>In general, that\u2019s it. And why is that? Because the length of the link was large \u2014 more than those 4k.<\/p>\n<p>Setting it to, say, 8kb (or as much as you\u2019re sure will be enough) solves the problem.<br \/>\nThat's the way it is.<br \/>\n<br \/>Source: <a content=\"nofollow\" rel=\"nofollow\" href=\"https:\/\/habr.com\/ru\/post\/484330\/\">habr.com<\/a><\/p>","protected":false,"gt_translate_keys":[{"key":"rendered","format":"html"}]},"excerpt":{"rendered":"<p>\u0421\u0442\u0430\u0442\u044c\u044f \u0438\u0437 \u0440\u0430\u0437\u0440\u044f\u0434\u0430 \u00ab\u0437\u0430\u043c\u0435\u0442\u043a\u0438 \u043d\u0430 \u043f\u043e\u043b\u044f\u0445\u00bb. TL:DR: http2_max_field_size 8k; # \u0432\u0441\u0435\u0445 \u0441\u043f\u0430\u0441\u0435\u0442! \u041d\u0430 \u043e\u0434\u043d\u043e\u043c \u0438\u0437 \u043f\u0440\u043e\u0435\u043a\u0442\u043e\u0432, \u043f\u043e\u0441\u043b\u0435 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u0432\u043d\u0443\u0442\u0440\u0435\u043d\u043d\u0435\u0439 \u043b\u043e\u0433\u0438\u043a\u0438 \u0431\u0435\u043a\u0435\u043d\u0434\u0430, \u043d\u0430\u0447\u0430\u043b \u043d\u0430\u0431\u043b\u044e\u0434\u0430\u0442\u044c \u0441\u0442\u0440\u0430\u043d\u043d\u044b\u0439 response_code \u0432 \u043b\u043e\u0433\u0430\u0445, \u0430 \u0438\u043c\u0435\u043d\u043d\u043e \u2014 0. \u0412 \u043b\u043e\u0433\u0430\u0445 \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u043f\u0440\u0438\u043c\u0435\u0440\u043d\u043e \u0442\u0430\u043a: { &quot;timestamp&quot;: &quot;2020-01-17T08:41:51+00:00&quot;, &quot;remote_addr&quot;: &quot;zzz.zzz.zzz.zzz&quot;, &quot;request_time&quot;: 0, &quot;upstream_response_time&quot;: &quot;&quot;, &quot;upstream_header_time&quot;: &quot;&quot;, &quot;http_accept_language&quot;: &quot;-language&quot;, &quot;response_status&quot;: 0, &quot;request&quot;: &quot;&quot;, &quot;host&quot;: [&hellip;]<\/p>\n","protected":false,"gt_translate_keys":[{"key":"rendered","format":"html"}]},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[688],"tags":[],"class_list":["post-55407","post","type-post","status-publish","format-standard","hentry","category-administrirovanie"],"aioseo_notices":[],"aioseo_head":"\n\t\t<!-- All in One SEO 5.0.2 - aioseo.com -->\n\t<meta name=\"description\" content=\"\u0421\u0442\u0430\u0442\u044c\u044f \u0438\u0437 \u0440\u0430\u0437\u0440\u044f\u0434\u0430 \u00ab\u0437\u0430\u043c\u0435\u0442\u043a\u0438 \u043d\u0430 \u043f\u043e\u043b\u044f\u0445\u00bb. TL:DR:http2_max_field_size 8k; # \u0432\u0441\u0435\u0445 \u0441\u043f\u0430\u0441\u0435\u0442! \u041d\u0430 \u043e\u0434\u043d\u043e\u043c \u0438\u0437 \u043f\u0440\u043e\u0435\u043a\u0442\u043e\u0432, \u043f\u043e\u0441\u043b\u0435 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u043e\u0439.\" \/>\n\t<meta name=\"robots\" content=\"max-image-preview:large\" \/>\n\t<meta name=\"author\" content=\"Yuri Gagarin\"\/>\n\t<link rel=\"canonical\" href=\"https:\/\/prohoster.info\/en\/blog\/administrirovanie\/nginx-kak-pobedit-response_status-0\" \/>\n\t<meta name=\"generator\" content=\"All in One SEO (AIOSEO) 5.0.2\" \/>\n\t\t<meta property=\"og:locale\" content=\"en_US\" \/>\n\t\t<meta property=\"og:site_name\" content=\"ProHoster | \u041a\u0443\u043f\u0438\u0442\u044c \u043d\u0430\u0434\u0435\u0436\u043d\u044b\u0439 \u0445\u043e\u0441\u0442\u0438\u043d\u0433 \u0434\u043b\u044f \u0441\u0430\u0439\u0442\u043e\u0432 \u0441 \u0437\u0430\u0449\u0438\u0442\u043e\u0439 \u043e\u0442 DDoS, VPS VDS \u0441\u0435\u0440\u0432\u0435\u0440\u044b\" \/>\n\t\t<meta property=\"og:type\" content=\"article\" \/>\n\t\t<meta property=\"og:title\" content=\"\ud83e\udd47[Nginx] \u041a\u0430\u043a \u043f\u043e\u0431\u0435\u0434\u0438\u0442\u044c response_status = 0 | ProHoster\" \/>\n\t\t<meta property=\"og:description\" content=\"\u0421\u0442\u0430\u0442\u044c\u044f \u0438\u0437 \u0440\u0430\u0437\u0440\u044f\u0434\u0430 \u00ab\u0437\u0430\u043c\u0435\u0442\u043a\u0438 \u043d\u0430 \u043f\u043e\u043b\u044f\u0445\u00bb. TL:DR:http2_max_field_size 8k; # \u0432\u0441\u0435\u0445 \u0441\u043f\u0430\u0441\u0435\u0442! \u041d\u0430 \u043e\u0434\u043d\u043e\u043c \u0438\u0437 \u043f\u0440\u043e\u0435\u043a\u0442\u043e\u0432, \u043f\u043e\u0441\u043b\u0435 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u043e\u0439.\" \/>\n\t\t<meta property=\"og:url\" content=\"https:\/\/prohoster.info\/en\/blog\/administrirovanie\/nginx-kak-pobedit-response_status-0\" \/>\n\t\t<meta property=\"og:image\" content=\"https:\/\/prohoster.info\/wp-content\/uploads\/2021\/11\/logo-350.jpg\" \/>\n\t\t<meta property=\"og:image:secure_url\" content=\"https:\/\/prohoster.info\/wp-content\/uploads\/2021\/11\/logo-350.jpg\" \/>\n\t\t<meta property=\"og:image:width\" content=\"350\" \/>\n\t\t<meta property=\"og:image:height\" content=\"350\" \/>\n\t\t<meta property=\"article:published_time\" content=\"2020-01-19T21:00:00+00:00\" \/>\n\t\t<meta property=\"article:modified_time\" content=\"2020-02-18T11:03:31+00:00\" \/>\n\t\t<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/prohoster\" \/>\n\t\t<meta property=\"article:author\" content=\"https:\/\/www.facebook.com\/prohoster\" \/>\n\t\t<!-- All in One SEO -->\n\n","aioseo_head_json":{"title":"\ud83e\udd47[Nginx] \u041a\u0430\u043a \u043f\u043e\u0431\u0435\u0434\u0438\u0442\u044c response_status = 0 | ProHoster","description":"An article of the \"marginal notes\" variety. TL:DR: http2_max_field_size 8k; # will save us all! On one of the projects, after changing some settings.","canonical_url":"https:\/\/prohoster.info\/en\/blog\/administrirovanie\/nginx-kak-pobedit-response_status-0","robots":"max-image-preview:large","keywords":"","webmasterTools":{"miscellaneous":""},"schema":null,"og:locale":"en_US","og:site_name":"ProHoster | \u041a\u0443\u043f\u0438\u0442\u044c \u043d\u0430\u0434\u0435\u0436\u043d\u044b\u0439 \u0445\u043e\u0441\u0442\u0438\u043d\u0433 \u0434\u043b\u044f \u0441\u0430\u0439\u0442\u043e\u0432 \u0441 \u0437\u0430\u0449\u0438\u0442\u043e\u0439 \u043e\u0442 DDoS, VPS VDS \u0441\u0435\u0440\u0432\u0435\u0440\u044b","og:type":"article","og:title":"\ud83e\udd47[Nginx] \u041a\u0430\u043a \u043f\u043e\u0431\u0435\u0434\u0438\u0442\u044c response_status = 0 | ProHoster","og:description":"\u0421\u0442\u0430\u0442\u044c\u044f \u0438\u0437 \u0440\u0430\u0437\u0440\u044f\u0434\u0430 \u00ab\u0437\u0430\u043c\u0435\u0442\u043a\u0438 \u043d\u0430 \u043f\u043e\u043b\u044f\u0445\u00bb. TL:DR:http2_max_field_size 8k; # \u0432\u0441\u0435\u0445 \u0441\u043f\u0430\u0441\u0435\u0442! \u041d\u0430 \u043e\u0434\u043d\u043e\u043c \u0438\u0437 \u043f\u0440\u043e\u0435\u043a\u0442\u043e\u0432, \u043f\u043e\u0441\u043b\u0435 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u043e\u0439.","og:url":"https:\/\/prohoster.info\/en\/blog\/administrirovanie\/nginx-kak-pobedit-response_status-0","og:image":"https:\/\/prohoster.info\/wp-content\/uploads\/2021\/11\/logo-350.jpg","og:image:secure_url":"https:\/\/prohoster.info\/wp-content\/uploads\/2021\/11\/logo-350.jpg","og:image:width":350,"og:image:height":350,"article:published_time":"2020-01-19T21:00:00+00:00","article:modified_time":"2020-02-18T11:03:31+00:00","article:publisher":"https:\/\/www.facebook.com\/prohoster","article:author":"https:\/\/www.facebook.com\/prohoster"},"aioseo_meta_data":{"post_id":"55407","title":null,"description":null,"keywords":null,"keyphrases":null,"primary_term":null,"canonical_url":null,"og_title":null,"og_description":null,"og_object_type":"default","og_image_type":"default","og_image_url":null,"og_image_width":null,"og_image_height":null,"og_image_custom_url":null,"og_image_custom_fields":null,"og_video":null,"og_custom_url":null,"og_article_section":null,"og_article_tags":null,"twitter_use_og":false,"twitter_card":"default","twitter_image_type":"default","twitter_image_url":null,"twitter_image_custom_url":null,"twitter_image_custom_fields":null,"twitter_title":null,"twitter_description":null,"schema":{"blockGraphs":[],"customGraphs":[],"default":{"data":{"Article":[],"Course":[],"Dataset":[],"FAQPage":[],"Movie":[],"Person":[],"Product":[],"ProductReview":[],"Car":[],"Recipe":[],"Service":[],"SoftwareApplication":[],"WebPage":[]},"graphName":"","isEnabled":true},"graphs":[]},"schema_type":null,"schema_type_options":null,"pillar_content":false,"robots_default":true,"robots_noindex":false,"robots_noarchive":false,"robots_nosnippet":false,"robots_nofollow":false,"robots_noimageindex":false,"robots_noodp":false,"robots_notranslate":false,"robots_max_snippet":null,"robots_max_videopreview":null,"robots_max_imagepreview":"large","priority":null,"frequency":null,"local_seo":null,"seo_analyzer_scan_date":null,"breadcrumb_settings":null,"limit_modified_date":false,"reviewed_by":null,"ai":null,"created":"2021-02-28 19:44:26","updated":"2026-02-09 17:28:53","focus_keyword":null,"additional_keywords":null,"truseo_locale":null},"gt_translate_keys":[{"key":"link","format":"url"}],"_links":{"self":[{"href":"https:\/\/prohoster.info\/en\/wp-json\/wp\/v2\/posts\/55407","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/prohoster.info\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/prohoster.info\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/prohoster.info\/en\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/prohoster.info\/en\/wp-json\/wp\/v2\/comments?post=55407"}],"version-history":[{"count":1,"href":"https:\/\/prohoster.info\/en\/wp-json\/wp\/v2\/posts\/55407\/revisions"}],"predecessor-version":[{"id":159518,"href":"https:\/\/prohoster.info\/en\/wp-json\/wp\/v2\/posts\/55407\/revisions\/159518"}],"wp:attachment":[{"href":"https:\/\/prohoster.info\/en\/wp-json\/wp\/v2\/media?parent=55407"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/prohoster.info\/en\/wp-json\/wp\/v2\/categories?post=55407"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/prohoster.info\/en\/wp-json\/wp\/v2\/tags?post=55407"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}