Welcome! Log In Create A New Profile

Advanced

Re: Problem with uWSGI and PATH_INFO

July 27, 2017 09:02AM
> Hi Roberto,
>
> My Django app runs perfectly ok under FastCGI and nginx but is not
> capable of resolving the proper PATH_INFO under uWSGI. In
> fastcgi_params, the value of PATH_INFO and SCRIPT_NAME are set to
> "$fastcgi_script_name". My nginx config looks like this:
>
> location / {
>
> uwsgi_pass django;
>
> include uwsgi_params;
>
> }
>
> My wsgi app (django-hotsauce) really relay on a HTTP/1.1 compatible
> PATH_INFO value, just like in wsgiref. Why is it not possible to
> implement $uwsgi_script_name variable for nginx?
>
> Best regards,
> Etienne
>
>

Hi,

if the url is something like /foo/bar and you have a location like

location /foo {
...
}

the WSGI standard expects SCRIPT_NAME to be /foo and PATH_INFO to be /bar

if you manually set SCRIPT_NAME to /foo in nginx, PATH_INFO will continue
to be /foo/bar.

Obviously having nginx managing it could be useful, but nowadays it is way
more versatile to manage this part in uWSGI itself (using the
manage-script-name or internal routing to manually rewrite apps), or
directly in your WSGI middleware.

your fastcgi adapter (i suppose flup) hardcodes this magic using the
classic apache fastcgi patterns (something we cannot rely on as we need to
support multiple environments)

--
Roberto De Ioris
http://unbit.com
_______________________________________________
nginx mailing list
nginx@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx
Subject Author Posted

Problem with uWSGI and PATH_INFO

Etienne Robillard July 27, 2017 07:48AM

Re: Problem with uWSGI and PATH_INFO

Etienne Robillard July 27, 2017 08:54AM

Re: Problem with uWSGI and PATH_INFO

roberto July 27, 2017 09:02AM

Re: Problem with uWSGI and PATH_INFO

Etienne Robillard July 27, 2017 09:20AM

Re: Problem with uWSGI and PATH_INFO

roberto July 27, 2017 09:54AM

Re: Problem with uWSGI and PATH_INFO

Etienne Robillard July 27, 2017 10:22AM

Re: Problem with uWSGI and PATH_INFO

roberto July 27, 2017 11:26AM

Re: Problem with uWSGI and PATH_INFO

Francis Daly July 27, 2017 11:26AM

Re: Problem with uWSGI and PATH_INFO

Etienne Robillard July 27, 2017 12:08PM

Re: Problem with uWSGI and PATH_INFO

roberto July 27, 2017 12:50PM

Re: Problem with uWSGI and PATH_INFO

Etienne Robillard July 27, 2017 01:06PM

Re: Problem with uWSGI and PATH_INFO

roberto July 27, 2017 01:46PM

Re: Problem with uWSGI and PATH_INFO

Etienne Robillard July 27, 2017 05:42PM

Re: Problem with uWSGI and PATH_INFO

roberto July 28, 2017 03:28AM

Re: Problem with uWSGI and PATH_INFO

Francis Daly July 28, 2017 03:18AM

Re: Problem with uWSGI and PATH_INFO

Etienne Robillard July 29, 2017 06:10AM

Re: Problem with uWSGI and PATH_INFO

Etienne Robillard August 05, 2017 11:50AM

Re: Problem with uWSGI and PATH_INFO

Francis Daly August 06, 2017 06:00AM

Re: Problem with uWSGI and PATH_INFO

roberto August 06, 2017 06:30AM

Re: Problem with uWSGI and PATH_INFO

Etienne Robillard August 06, 2017 06:54AM

Re: Problem with uWSGI and PATH_INFO

roberto August 06, 2017 10:12AM

Re: Problem with uWSGI and PATH_INFO

Etienne Robillard August 07, 2017 05:08AM

Re: Problem with uWSGI and PATH_INFO

Francis Daly August 08, 2017 02:14PM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 324
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 500 on July 15, 2024
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready