<div dir="ltr"><div dir="ltr"><div>Pass {serial} to your proxy from a normal nginx args variable.  <br></div><div>location /another_script {<br></div>    proxy_pass <a href="http://server/cgi-bin/another_script.py?%7Bserial%7D" rel="noreferrer" target="_blank">http://server/cgi-bin/another_script.py?</a>$args</div><div>}<br></div><div>And then you'll likely want to change from environ to the query string.  I would also make this ?serial=foo.  As the query params are converted to a dict/dataclass.</div><div><br></div><div class="gmail_quote gmail_quote_container"><div dir="ltr" class="gmail_attr">On Fri, Dec 27, 2024 at 4:15 PM Ralf Figge via nginx <<a href="mailto:nginx@nginx.org">nginx@nginx.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Hello,<br>
<br>
i am a newbee from nginx. I need to run a python script via cgi-bin. I <br>
search for information about python and nginx, and found fcgiwrap und <br>
uwsig.<br>
I test uwsig (as cgi-bin), but there i become only error 502 Gateway <br>
error. fcgiwrap looks like better, But i have 1 problem with it:<br>
Here some code for the sript;<br>
----------------------------<br>
#!/usr/bin/python3<br>
<br>
import os<br>
environ = os.environ<br>
serial = "unknown"<br>
     serial = environ["SERIAL"]<br>
serial = serial.strip()<br>
...<br>
<a href="http://server/cgi-bin/another_script.py?%7Bserial%7D" rel="noreferrer" target="_blank">http://server/cgi-bin/another_script.py?{serial}</a><br>
---------------------------------------------------<br>
<br>
My Problem is, that the call "another_script.py" does not have the <br>
parameter "?{serial}". (i make a tcpdump from the interface) Has <br>
somebody any idea, why it doesn´t go with fcgiwrap?<br>
<br>
It runs under Debian 12, python 3.12, nginx 1.26.2 .<br>
<br>
regards<br>
Ralf<br>
_______________________________________________<br>
nginx mailing list<br>
<a href="mailto:nginx@nginx.org" target="_blank">nginx@nginx.org</a><br>
<a href="https://mailman.nginx.org/mailman/listinfo/nginx" rel="noreferrer" target="_blank">https://mailman.nginx.org/mailman/listinfo/nginx</a><br>
</blockquote></div></div>