From patchwork Tue Sep 6 20:37:03 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Thomas Monjalon X-Patchwork-Id: 666737 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.ozlabs.org (lists.ozlabs.org [103.22.144.68]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3sTJLY0blnz9sBR for ; Wed, 7 Sep 2016 06:37:25 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=6wind-com.20150623.gappssmtp.com header.i=@6wind-com.20150623.gappssmtp.com header.b=py+o+1VV; dkim-atps=neutral Received: from ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 3sTJLX6jqTzDrpW for ; Wed, 7 Sep 2016 06:37:24 +1000 (AEST) Authentication-Results: lists.ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=6wind-com.20150623.gappssmtp.com header.i=@6wind-com.20150623.gappssmtp.com header.b=py+o+1VV; dkim-atps=neutral X-Original-To: patchwork@lists.ozlabs.org Delivered-To: patchwork@lists.ozlabs.org Received: from mail-wm0-x231.google.com (mail-wm0-x231.google.com [IPv6:2a00:1450:400c:c09::231]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 3sTJLQ5Z9szDrp2 for ; Wed, 7 Sep 2016 06:37:18 +1000 (AEST) Authentication-Results: lists.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=6wind-com.20150623.gappssmtp.com header.i=@6wind-com.20150623.gappssmtp.com header.b=py+o+1VV; dkim-atps=neutral Received: by mail-wm0-x231.google.com with SMTP id 1so211216618wmz.1 for ; Tue, 06 Sep 2016 13:37:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=6wind-com.20150623.gappssmtp.com; s=20150623; h=from:to:subject:date:message-id:mime-version :content-transfer-encoding; bh=g3AmbOYIK9WhE2c0muQcdQp11/z1PlV/gRbX0lL4usQ=; b=py+o+1VVha2RuSRl4Nj6P6sScsJ2WRWQvC8XZDOtJTWBbvheFEXraUSPgQWeDXBBW5 M0EP0PawN9RaZ1hiRPxai3Qdr/7a6G9vyAvj8MfsWTcVFn52AXwlQGKNM7/u8ZhJdHyy JRmq+tA+EGNkl8nIMX845lEU1BYZr1Fsd22ygFR0xE+0vAELzl1KH+ummUDzwMzphH5m RkDaTBGBc7cm3t27FexUUgI9dbt3Rkqz0K1rK0KYAL07x8+sVL/kELeObBO6Nk3nrLCV beCYjhzq6GtlmmpvKWbfuDA3rTM6Ud0gVTU9zd332oxMPsygljDP/fswOS0eB8oqlh/5 m5Kw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:subject:date:message-id:mime-version :content-transfer-encoding; bh=g3AmbOYIK9WhE2c0muQcdQp11/z1PlV/gRbX0lL4usQ=; b=DixaEMmHrdl13FiIcqh+WCKW06DFORriiJX1/JI25pIlB+Lz/rNyZChJqzgYW2yxU7 J/Op9FFSNQBH3A+nBXv6Jr88woG/nWjMz2VnLC/PVDPiHNo4+GQS2/PsfkLBRIxhcq9Y yiuAaaXDh0ltWK8Mpl3yma6LyfHkOiMwLbg6nub/QkCx3gRSxppn1uqOecQwrupvmAKY VXAb+Two/fKUfiOivrMOZYF9jFmB8BGyGX2no1oOU34e6yqJ5qesqJg1iCVAdBaJ2/13 gtqLMQoyAfpiuWh1GKmWXd6ZU5bZr+cd4+7fldN1hwO7Ed/McwS/d72SEWFBjPW7OA8N CqDg== X-Gm-Message-State: AE9vXwPcGQ/IHsmBEcjcGMf79n5T0J6tAk6UOU/ahQQAseJLgzEQ0+LoHsB6WXyEwI/Gvfvw X-Received: by 10.194.200.36 with SMTP id jp4mr42659598wjc.26.1473194232253; Tue, 06 Sep 2016 13:37:12 -0700 (PDT) Received: from XPS13.localdomain (184.203.134.77.rev.sfr.net. [77.134.203.184]) by smtp.gmail.com with ESMTPSA id pm1sm35102486wjb.40.2016.09.06.13.37.10 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 06 Sep 2016 13:37:11 -0700 (PDT) From: Thomas Monjalon To: patchwork@lists.ozlabs.org Subject: [PATCH] lib: Refresh nginx/uwsgi configuration Date: Tue, 6 Sep 2016 22:37:03 +0200 Message-Id: <1473194223-20497-1-git-send-email-thomas.monjalon@6wind.com> X-Mailer: git-send-email 2.7.0 MIME-Version: 1.0 X-BeenThere: patchwork@lists.ozlabs.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: Patchwork development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: patchwork-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org Sender: "Patchwork" As stated in http://uwsgi-docs.readthedocs.io/en/latest/Nginx.html: " Unfortunately nginx is not able to rewrite PATH_INFO accordingly to SCRIPT_NAME. For such reason you need to instruct uWSGI to map specific apps in the so called “mountpoint” and rewrite SCRIPT_NAME and PATH_INFO automatically [...] ancient uWSGI versions used to support the so called “uwsgi_modifier1 30” approach. Do not do it. it is a really ugly hack " Replacing the uwsgi_modifier1 hack by a mount point seems to work. Signed-off-by: Thomas Monjalon Reviewed-by: Stephen Finucane --- lib/nginx/patchwork.conf | 1 - lib/uwsgi/patchwork.ini | 5 +++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/nginx/patchwork.conf b/lib/nginx/patchwork.conf index 5479496..1e69d1a 100644 --- a/lib/nginx/patchwork.conf +++ b/lib/nginx/patchwork.conf @@ -35,7 +35,6 @@ http { location / { include uwsgi_params; uwsgi_pass unix:/run/uwsgi/patchwork.sock; - uwsgi_modifier1 30; } } } diff --git a/lib/uwsgi/patchwork.ini b/lib/uwsgi/patchwork.ini index fc0f0ed..04a9837 100644 --- a/lib/uwsgi/patchwork.ini +++ b/lib/uwsgi/patchwork.ini @@ -6,11 +6,16 @@ project = patchwork base = /opt user = www-data group = www-data +url = / chdir = %(base)/%(project) pythonpath = %(base)/%(project) module = %(project).wsgi:application +# rewrite PATH_INFO and SCRIPT_NAME according to mount-points (for nginx) +manage-script-name = true +mount = %(url)=%(module) + master = true processes = 5 # increase buffer size to avoid "502 bad gateway error"