Skip to content

Commit dc7bf1c

Browse files
Thomas Monjalonstephenfin
authored andcommitted
lib: Refresh nginx/uwsgi configuration
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>
1 parent 2fe9983 commit dc7bf1c

2 files changed

Lines changed: 5 additions & 1 deletion

File tree

lib/nginx/patchwork.conf

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@ http {
3535
location / {
3636
include uwsgi_params;
3737
uwsgi_pass unix:/run/uwsgi/patchwork.sock;
38-
uwsgi_modifier1 30;
3938
}
4039
}
4140
}

lib/uwsgi/patchwork.ini

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,16 @@ project = patchwork
66
base = /opt
77
user = www-data
88
group = www-data
9+
url = /
910

1011
chdir = %(base)/%(project)
1112
pythonpath = %(base)/%(project)
1213
module = %(project).wsgi:application
1314

15+
# rewrite PATH_INFO and SCRIPT_NAME according to mount-points (for nginx)
16+
manage-script-name = true
17+
mount = %(url)=%(module)
18+
1419
master = true
1520
processes = 5
1621
# increase buffer size to avoid "502 bad gateway error"

0 commit comments

Comments
 (0)