]> git.ipfire.org Git - thirdparty/patchwork.git/commitdiff
lib: Refresh nginx/uwsgi configuration
authorThomas Monjalon <thomas.monjalon@6wind.com>
Tue, 6 Sep 2016 20:37:03 +0000 (22:37 +0200)
committerStephen Finucane <stephenfinucane@hotmail.com>
Wed, 7 Sep 2016 20:03:37 +0000 (21:03 +0100)
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 <thomas.monjalon@6wind.com>
lib/nginx/patchwork.conf
lib/uwsgi/patchwork.ini

index 5479496d28f95d198c5ed4e23463ef89c5af41d1..1e69d1a9239840ac55cd2ffbe4ea40e0291148b3 100644 (file)
@@ -35,7 +35,6 @@ http {
         location / {
             include uwsgi_params;
             uwsgi_pass unix:/run/uwsgi/patchwork.sock;
-            uwsgi_modifier1 30;
         }
     }
 }
index fc0f0ed2625d6a342569090ff1c0ceb9fc81cd58..04a9837bd2ca4b3b683e848a4489206cc7f9a486 100644 (file)
@@ -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"