Welcome! Log In Create A New Profile

Advanced

Re: Problem with uWSGI and PATH_INFO

August 06, 2017 06:30AM
> On Sat, Aug 05, 2017 at 11:47:24AM -0400, Etienne Robillard wrote:
>
> Hi there,
>
>> The workaround suggested below is not working.
>
> From the words here, it is not clear to me what specific configuration
> you are using.
>
>> The only case where
>> Django correctly handle uWSGI transport is when PATH_INFO is set to
>> DOCUMENT_URI in uwsgi_params. So can someone please explain how to
>> set uWSGI to run a WSGI app in FastCGI (backward-compatible) mode?
>
> I don't know enough about Django to understand that question.
>
> I do know enough about nginx to believe that nginx does not care what
> Django does.
>
> The only thing that seems to be missing, from an nginx perspective, is:
> what does the uwsgi-server want to receive for this request?
>
> That is:
>
>> >>It all comes down to: for one specific http request, what values do
>> >>you want SCRIPT_NAME and PATH_INFO to have when they are sent to the
>> >>uwsgi upstream?
>
> If someone will provide one explicit example of what behaviour is wanted,
> then it may be clear what the appropriate nginx config for this case is.
>
>

This is what any compliant WSGI server (included uWSGI) expects:

https://www.python.org/dev/peps/pep-0333/#environ-variables

nginx is not able to correctly split PATH_INFO accordingly to SCRIPT_NAME
(and technically it should not do it as uwsgi is a transport only protocol
and the server could make any kind of assumptions about variables).

For this reason you need to instruct uWSGI to rewrite PATH_INFO
accordingly (like shown in the previous posts). There can be no magic in
uWSGI to rewrite it as it would mean infering what the user want to do.

The solution is using uWSGI to rewrite it (it has at least 3 ways)

Unfortunately i am not able to help better :)

--
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: 125
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready