{"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 del tipo \u00abappunti nel margine\u00bb.<\/p>\n<p><b class=\"spoiler_title\">TL:DR:<\/b><\/p>\n<pre><code class=\"nginx\">http2_max_field_size 8k; # tutti salveranno!<\/code><\/pre>\n<p>In un progetto, dopo aver modificato una certa logica interna del backend, ho iniziato 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  \"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 \/>\nLeggere la documentazione e cercare su Google su questo argomento non ha portato a nulla \u2014 poich\u00e9 si afferma che tale comportamento si verifica quando il client ha chiuso la connessione senza inviare le intestazioni. E un po' di stranezze con la dimensione del buffer per wsgi_, che nel nostro caso non \u00e8 affatto adatta.<\/p>\n<p>In generale, abbiamo deciso che il problema non \u00e8 un problema, considerando che nei nostri volumi non \u00e8 affatto critico.<\/p>\n<p>Fino al momento in cui non mi \u00e8 stata posta la seguente domanda: in alcuni casi i link si aprono senza problemi tramite http, ma rifiutano categoricamente di funzionare tramite https, restituendo un meraviglioso: Connection #0 to host example.com left intact<br \/>\ncurl: (52) Risposta vuota dal server<\/p>\n<p>Nei log, \u00e8 stato possibile risalire a questa cosa solo tramite IP \u2014 n\u00e9 richieste n\u00e9 altri dati, come si pu\u00f2 vedere dall'esempio sopra \u2014 ci sono. Solo il famigerato stato 0, ma so che non ho interrotto la richiesta! Ho iniziato a scavare su cosa potesse andare storto. E la soluzione \u00e8 stata 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 connessioni ssl, non basta configurare solo i buffer della richiesta, ma \u00e8 necessario configurarli anche in ngx_http_v2_module, e precisamente:<\/p>\n<pre><code class=\"plaintext\">Sintassi:\thttp2_max_field_size dimensione;\nValore predefinito:\thttp2_max_field_size 4k;\nContesto:\thttp, server\n<\/code><\/pre>\n<p>\n<i>Limita la dimensione massima dell'intestazione della richiesta, compressa con HPACK. Il limite si applica ugualmente sia al nome che al valore. Se viene utilizzata la codifica di Huffman, la dimensione effettiva delle stringhe non compresse pu\u00f2 essere maggiore. Il limite predefinito \u00e8 adeguato per la maggior parte delle richieste.<\/i><\/p>\n<p>In generale, \u00e8 questo. E perch\u00e9? Perch\u00e9 la lunghezza del link era grande \u2014 pi\u00f9 di 4k.<\/p>\n<p>Impostandolo, ad esempio, su 8kb (o quanto basta sicuramente) \u2014 risolviamo il problema.<br \/>\nEcco fatto.<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 5.0.1.1 - 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\/it\/blog\/administrirovanie\/nginx-kak-pobedit-response_status-0\" \/>\n\t<meta name=\"generator\" content=\"All in One SEO (AIOSEO) 5.0.1.1\" \/>\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.\" \/>\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":"Un articolo del tipo \u00abnote a margine\u00bb. TL:DR: http2_max_field_size 8k; # salver\u00e0 tutti! In uno dei progetti, dopo aver cambiato alcune.","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.","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","focus_keyword":null,"additional_keywords":null,"truseo_locale":null},"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}]}}