WSGI gets no QUERY_STRING

Jason Eads jeads442 at gmail.com
Sat Sep 1 16:35:54 UTC 2018


It appears that this issue was not a problem with nginx unit.

After wasting a lot of time with the very misleading Q&A thread
https://stackoverflow.com/questions/8130692/how-can-query-string-parameters-be-forwarded-through-a-proxy-pass-with-nginx
I determined that no unusual nginx configuration change was necessary to
pass the parameters via proxy_pass.

The shell was trimming anything following an '&' character unless the url
was surrounded with quotation marks.
For example:
curl "127.0.0.1:8888?v1=1&v2=2 <http://127.0.0.1:8888/?v1=1&v2=2>"

There was a bug in my detection code that failed to recognize when the
issue had been fixed.

On Thu, Aug 30, 2018 at 3:33 AM Jason Eads <jeads442 at gmail.com> wrote:

> I'm using nginx unit. I'm attempting to pass a query string to a python
> script that unit is hosting via curl as a test. A hello_world.py example
> works fine, implying unit configuration is not the issue. Example URLs
> listed below. My code is receiving an empty string for
> environ.QUERY_STRING in every case. What is the appropriate procedure or
> URL format to pass arguments into a wsgi python script via nginx unit?
>
> My tests showed that with module set no additional path needed to be
> provided. The IP address and port was enough to run hello_world.py.
>
> VARIATIONS:
> curl 127.0.0.1:8888?v1=1&v2=2
> curl 127.0.0.1:8888/?v1=1&v2=2
> curl 127.0.0.1:8888/index?v1=1&v2=2
> curl 127.0.0.1:8888/index.py?v1=1&v2=2
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.nginx.org/pipermail/unit/attachments/20180901/e0e65e14/attachment.html>


More information about the unit mailing list