From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp1 ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms11 with LMTPS id ndIHM+47OmDnIwAA0tVLHw (envelope-from ) for ; Sat, 27 Feb 2021 12:32:46 +0000 Received: from aspmx1.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp1 with LMTPS id WPJULu47OmDsQQAAbx9fmQ (envelope-from ) for ; Sat, 27 Feb 2021 12:32:46 +0000 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id BB5D52502D for ; Sat, 27 Feb 2021 13:32:45 +0100 (CET) Received: from localhost ([::1]:43150 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lFym3-0002v8-ST for larch@yhetil.org; Sat, 27 Feb 2021 07:32:43 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:36394) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lFylR-0002rZ-S9 for bug-guix@gnu.org; Sat, 27 Feb 2021 07:32:05 -0500 Received: from debbugs.gnu.org ([209.51.188.43]:60029) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lFylO-00044o-FM for bug-guix@gnu.org; Sat, 27 Feb 2021 07:32:05 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1lFylO-0006x1-Cn for bug-guix@gnu.org; Sat, 27 Feb 2021 07:32:02 -0500 X-Loop: help-debbugs@gnu.org Subject: bug#46807: [website] return 404 with HTTP header 'Accept-Language: zh-CN, zh' Resent-From: Tobias Geerinckx-Rice Original-Sender: "Debbugs-submit" Resent-CC: bug-guix@gnu.org Resent-Date: Sat, 27 Feb 2021 12:32:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 46807 X-GNU-PR-Package: guix X-GNU-PR-Keywords: To: ylc991 Cc: 46807@debbugs.gnu.org X-Debbugs-Original-Cc: bug-guix@gnu.org, 46807@debbugs.gnu.org Received: via spool by 46807-submit@debbugs.gnu.org id=B46807.161442910625843 (code B ref 46807); Sat, 27 Feb 2021 12:32:02 +0000 Received: (at 46807) by debbugs.gnu.org; 27 Feb 2021 12:31:46 +0000 Received: from localhost ([127.0.0.1]:43338 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lFyl8-0006iN-AW for submit@debbugs.gnu.org; Sat, 27 Feb 2021 07:31:46 -0500 Received: from tobias.gr ([80.241.217.52]:35366) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lFyl6-0006fo-Iw for 46807@debbugs.gnu.org; Sat, 27 Feb 2021 07:31:45 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tobias.gr; s=2018; bh=LhcCRRTr3GC2i9AvSiF5vVEwT20vpRFNK/K+aGOvfCQ=; h=date:in-reply-to: references:subject:cc:to:from; b=QKLbm9ZP5YfSMUAkn2tDy1ZobeTdvbpAdbt7u u4kDeh54AOrbEfJP+zpxDIq2jX6yXrBu1mpeGiN9uuzllQWGJyHuuG+VBnGwa7eZFrQIqF GZhsEcJ1GFs8aGHK5NcrPP8GrSBkzbnFeUdn4dZ6qfe6+ZNcqTaVA7j2vO1wLjQ8HhBeBv XNS88nYXDgVWFtnvKmbmwK5TBtrRsjwBXIAjKE2mJRckJHlmQ/O0pbKnJpWR2haD6Ytzkw XJ0LoIBdrSYRy6c+cW69cguhy5oiEUXYGtB0w9kl2CoKs7Hvf10l7sKRacyh6zmMaizFYb N0b1IVPJbVUQjEORzOPg3sTRQ== Received: by submission.tobias.gr (OpenSMTPD) with ESMTPSA id 739cde64 (TLSv1.2:ECDHE-ECDSA-AES256-GCM-SHA384:256:NO); Sat, 27 Feb 2021 12:32:36 +0000 (UTC) BIMI-Selector: v=BIMI1; s=default; References: In-reply-to: Date: Sat, 27 Feb 2021 13:31:40 +0100 Message-ID: <87czwl66ab.fsf@nckx> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha512; protocol="application/pgp-signature" X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-guix@gnu.org List-Id: Bug reports for GNU Guix List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-guix-bounces+larch=yhetil.org@gnu.org Sender: "bug-Guix" Reply-to: Tobias Geerinckx-Rice From: Tobias Geerinckx-Rice via Bug reports for GNU Guix X-Migadu-Flow: FLOW_IN ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1614429166; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:resent-cc:resent-from:resent-sender: resent-message-id:in-reply-to:in-reply-to:references:references: list-id:list-help:list-unsubscribe:list-subscribe:list-post: dkim-signature; bh=LhcCRRTr3GC2i9AvSiF5vVEwT20vpRFNK/K+aGOvfCQ=; b=Tk+xichGICVlwgQdfXsztUZmY3WC+EV1DJXADpOsUD358+ZEI03uOUSsNW3GtiF8xUvq3J O2Q/sP/js98sm24YC34ugOKkeiJDhpHDTayqMl0Hjvz8at7A0K1lr9Cjdt73q2VJjQilrU vsrJfAgJOKMRBX3DjPafkEvVwHPboaq/7kR+YggpxL1ocxMLphLsBVlgn0EobZix7Rrusj hWFTeNySLA9IHVXl1tG9Wc464K5edmXmZ7eSr/GXid+mW+vE44VlcjZCyXm0La9o5R9HRL Ag7BSlnKWeum1ACZ7f7hZNLc4vequC4SeorLqQ3NfUrYbaxLfrtErmbyHhWf6Q== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1614429166; a=rsa-sha256; cv=none; b=Sjag1g3GKUmAznCS1ylZcwO7RH8xVRbDqiVL9fJ62gN8fWUaCafEJzDpUX6BmiGAWyGL20 /vt5+gCyXoynu7p8N+wMNIxWYYWpIoU+PXt42Y+JM8y3mY/7AhdeBTmn2HgQ8O216Nm7p+ qjCe2xPOsY5IzmHE9mTx53LwTupOWBJFi/xfRpYu6xRCxr2+TWfHbfsMAYMPWIuI+Nn5UW GwcNLVferi/UVlWPrtNRGTXIcNCDpxKyWYq0YS3TQWs6Q/PKbGZqqc/3e/VHMdt1rFZrXD IuCCX7pJ9zOm5TDkGkGDnoSD9R8fI9/wVElCWClb3suDT9zoorVFIlKlzc+rcQ== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=tobias.gr header.s=2018 header.b=QKLbm9ZP; dmarc=pass (policy=none) header.from=gnu.org; spf=pass (aspmx1.migadu.com: domain of bug-guix-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=bug-guix-bounces@gnu.org X-Migadu-Spam-Score: -2.97 Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=tobias.gr header.s=2018 header.b=QKLbm9ZP; dmarc=pass (policy=none) header.from=gnu.org; spf=pass (aspmx1.migadu.com: domain of bug-guix-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=bug-guix-bounces@gnu.org X-Migadu-Queue-Id: BB5D52502D X-Spam-Score: -2.97 X-Migadu-Scanner: scn0.migadu.com X-TUID: oL6uZMsSD0ds --=-=-= Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: quoted-printable Ylc991, Thanks for the report! My verbose notes so far; I need to (finally!) set up a local build=20 of the Web site first. ylc991 =E5=86=99=E9=81=93=EF=BC=9A > Hello! My webbrowser has set =E2=80=98Accept-Language=E2=80=99 to 'zh-CN,= zh' by=20 > default, and https://guix.gnu.org returns 404. Indeed, handling of zh-CN specifically is broken. :-( =2D-8<---------------cut here---------------start------------->8--- ~ =CE=BB curl -LI -H 'Accept-Language: zh-cn' https://guix.gnu.org HTTP/1.1 404 Not Found [...] =2D-8<---------------cut here---------------end--------------->8--- This is because our nginx configuration=20 (maintenance/hydra/nginx/berlin.scm) does: =2D-8<---------------cut here---------------start------------->8--- set_from_accept_language $lang en de es fr zh-CN; [...] try_files $uri /$lang/$uri /$lang/$uri/index.html =3D404; =2D-8<---------------cut here---------------end--------------->8--- i.e., it looks in /srv/guix.gnu.org/zh-CN, but our website uses... =2D-8<---------------cut here---------------start------------->8--- nckx@berlin ~$ ls -d /srv/guix.gnu.org/zh* /srv/guix.gnu.org/zh-cn/ =2D-8<---------------cut here---------------end--------------->8--- ...lowercase. This questionable choice comes from=20 artwork/po/ietf-tags.scm: =2D-8<---------------cut here---------------start------------->8--- ;;; This file contains an association list for each translation=20 from ;;; the locale to an IETF language tag to be used in the URL path=20 of ;;; translated pages. The language tag results from the=20 translation ;;; team<80><99>s language code from ;;; . The=20 underscore ;;; in the team<80><99>s code is replaced by a hyphen. For=20 example, az would ;;; be used for the Azerbaijani language (not az-Latn) and zh-CN=20 would ;;; be used for mainland Chinese (not zh-Hans-CN) ([...] ("zh_CN" . "zh-cn")) =2D-8<---------------cut here---------------end--------------->8--- Questionable only because, while a lowercase region is technically=20 valid, it's so rare that it's likely to cause problems -- as we=20 found out. > I have tested with curl, 'zh-CN,zh', 'zh-CN', [is 404] These are valid, so the nginx accept-language module accepts them,=20 but then looks for a subdirectory that doesn't exist and returns=20 404. > 'zh-cn' is 404 This is valid, but since we configure the accept-language module=20 to use =E2=80=98zh-CN=E2=80=99 it normalises $lang to the latter. Which is= good,=20 but it causes the same 404 as above. > 'zh_CN' is 200. This is bogus (=E2=80=98_=E2=80=99 is not valid), hence ignored, and so the= site=20 falls back to English 200. > 'zh' [is 200] Valid but the accept-language module is not clever; we need to add=20 an explicit 'zh' entry for that to work: =2D-8<---------------cut here---------------start------------->8--- set_from_accept_language $lang en de es fr zh-CN zh en; =2D-8<---------------cut here---------------end--------------->8--- I expect that adding it and changing ietf-tags.scm to use "zh-CN"=20 will fix both 404s, but need to check that it doesn't break=20 anything else. The other untested solution is using lowercase =2D-8<---------------cut here---------------start------------->8--- set_from_accept_language $lang en de es fr zh-cn zh en; =2D-8<---------------cut here---------------end--------------->8--- but I--assuming that even works--'m not fond of making the=20 unconventional the norm. Kind regards, T G-R --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iIMEARYKACsWIQT12iAyS4c9C3o4dnINsP+IT1VteQUCYDo7rQ0cbWVAdG9iaWFz LmdyAAoJEA2w/4hPVW15JtwBANSsU7nb49XCqb+SwuiKIoJrdYEqizNZP5OPmoSg zN1VAPsHOqOQ6yL6TCgmq/oyIpHoZvk7x4W5VJqp2I9uHGLICg== =MWX4 -----END PGP SIGNATURE----- --=-=-=--