{"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\/it\/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>Articolo di tipo \u00abappunti laterali\u00bb.<\/p>\n<p><b class=\"spoiler_title\">TL:DR:<\/b><\/p>\n<pre><code class=\"nginx\">http2_max_field_size 8k; # salver\u00e0 tutti!<\/code><\/pre>\n<p>In uno dei progetti, dopo aver modificato alcune logiche interne del backend, ho cominciato a notare un strano response_code nei log, precisamente \u2014 0. Nei log appare pi\u00f9 o meno cos\u00ec:<\/p>\n<pre><code class=\"json\">{\n  &quot;timestamp&quot;: &quot;2020-01-17T08:41:51+00:00&quot;,\n  &quot;remote_addr&quot;: &quot;zzz.zzz.zzz.zzz&quot;,\n  &quot;request_time&quot;: 0,\n  &quot;upstream_response_time&quot;: &quot;&quot;,\n  &quot;upstream_header_time&quot;: &quot;&quot;,\n  &quot;http_accept_language&quot;: &quot;-language&quot;,\n  &quot;response_status&quot;: 0,\n  &quot;request&quot;: &quot;&quot;,\n  &quot;host&quot;: &quot;example.com&quot;,\n  &quot;upstream_addr&quot;: &quot;&quot;,\n  &quot;http_referrer&quot;: &quot;&quot;,\n  &quot;request_length&quot;: 5854,\n  &quot;bytes_sent&quot;: 0,\n  &quot;http_user_agent&quot;: &quot;&quot;\n}\n<\/code><\/pre>\n<p><noindex><a rel=\"nofollow\" name=\"habracut\"><\/a><\/noindex><br \/>\nLeggere la documentazione e cercare su Google riguardo a questo argomento non ha portato a nulla \u2014 poich\u00e9 si afferma che questo comportamento si verifica quando il client chiude la connessione senza inviare intestazioni. E c'era anche un po' di esotismo con le dimensioni del buffer per wsgi_, che nel nostro caso non erano affatto adatte.<\/p>\n<p>In generale, abbiamo deciso che il problema non era un problema, considerando che sui nostri volumi non era affatto critico.<\/p>\n<p>Fino a quando non mi \u00e8 stata posta la seguente domanda: in alcuni casi, i link si aprono senza problemi via http, ma rifiutano completamente di funzionare via https, dando un meraviglioso: Connection #0 to host example.com left intact<br \/>\ncurl: (52) Risposta vuota dal server<\/p>\n<p>Nei log vengono tracciati solo tramite IP \u2014 non ci sono richieste n\u00e9 altri dati, come mostrato nell'esempio sopra. Solo il famigerato stato 0, ma so che non ho interrotto la richiesta! Ho iniziato a scavare per capire cosa potesse andare storto. E tutto si \u00e8 rivelato molto semplice:<\/p>\n<p><i>listen 443 <a class=\"wpil_keyword_link\" href=\"https:\/\/prohoster.info\/it\/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>Quindi, se si utilizza http2 per le connessioni SSL, non \u00e8 sufficiente configurare i buffer delle richieste, ma \u00e8 necessario configurarli anche in ngx_http_v2_module, precisamente:<\/p>\n<pre><code class=\"plaintext\">Sintassi:\thttp2_max_field_size dimensione;\nPredefinito:\thttp2_max_field_size 4k;\nContesto:\thttp, server\n<\/code><\/pre>\n<p>\n<i>Limita la dimensione massima dell'intestazione della richiesta, compressa usando HPACK. La limitazione si applica in egual modo sia al nome che al valore. Se viene utilizzata la codifica Huffman, la dimensione effettiva delle stringhe decompresse di nome e valore pu\u00f2 essere maggiore. La limitazione predefinita si adatta alla maggior parte delle richieste.<\/i><\/p>\n<p>Insomma, \u00e8 tutto qui. E perch\u00e9? Perch\u00e9 la lunghezza del link era lunga \u2014 pi\u00f9 di quei famosi 4k.<\/p>\n<p>Impostandolo, ad esempio, a 8kb (o quanto basta) \u2014 risolviamo il problema.<br \/>\nQueste sono le situazioni.<br \/>\n<br \/>Fonte: <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 4.9.10 - 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 \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;: &quot;example.com&quot;,\" \/>\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\/it\/blog\/administrirovanie\/nginx-kak-pobedit-response_status-0\" \/>\n\t<meta name=\"generator\" content=\"All in One SEO (AIOSEO) 4.9.10\" \/>\n\t\t<meta property=\"og:locale\" content=\"it_IT\" \/>\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 \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;: &quot;example.com&quot;,\" \/>\n\t\t<meta property=\"og:url\" content=\"https:\/\/prohoster.info\/it\/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":"Articolo del tipo \u00abnote a margine\u00bb. TL:DR: http2_max_field_size 8k; # salver\u00e0 tutti! In un progetto, dopo una modifica a una certa logica interna del backend, ho iniziato a notare un strano response_code nei log, ovvero \u2014 0. Nei log appare circa cos\u00ec: { \"timestamp\": \"2020-01-17T08:41:51+00:00\", \"remote_addr\": \"zzz.zzz.zzz.zzz\", \"request_time\": 0, \"upstream_response_time\": \"\", \"upstream_header_time\": \"\", \"http_accept_language\": \"-language\", \"response_status\": 0, \"request\": \"\", \"host\": \"example.com\",","canonical_url":"https:\/\/prohoster.info\/it\/blog\/administrirovanie\/nginx-kak-pobedit-response_status-0","robots":"max-image-preview:large","keywords":"","webmasterTools":{"miscellaneous":""},"schema":null,"og:locale":"it_IT","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 \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;: &quot;example.com&quot;,","og:url":"https:\/\/prohoster.info\/it\/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"},"gt_translate_keys":[{"key":"link","format":"url"}],"_links":{"self":[{"href":"https:\/\/prohoster.info\/it\/wp-json\/wp\/v2\/posts\/55407","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/prohoster.info\/it\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/prohoster.info\/it\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/prohoster.info\/it\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/prohoster.info\/it\/wp-json\/wp\/v2\/comments?post=55407"}],"version-history":[{"count":1,"href":"https:\/\/prohoster.info\/it\/wp-json\/wp\/v2\/posts\/55407\/revisions"}],"predecessor-version":[{"id":159518,"href":"https:\/\/prohoster.info\/it\/wp-json\/wp\/v2\/posts\/55407\/revisions\/159518"}],"wp:attachment":[{"href":"https:\/\/prohoster.info\/it\/wp-json\/wp\/v2\/media?parent=55407"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/prohoster.info\/it\/wp-json\/wp\/v2\/categories?post=55407"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/prohoster.info\/it\/wp-json\/wp\/v2\/tags?post=55407"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}