Pass {serial} to your proxy from a normal nginx args variable. location /another_script { proxy_pass http://server/cgi-bin/another_script.py? <http://server/cgi-bin/another_script.py?%7Bserial%7D>$args } 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.
On Fri, Dec 27, 2024 at 4:15 PM Ralf Figge via nginx <nginx@nginx.org> wrote: > Hello, > > i am a newbee from nginx. I need to run a python script via cgi-bin. I > search for information about python and nginx, and found fcgiwrap und > uwsig. > I test uwsig (as cgi-bin), but there i become only error 502 Gateway > error. fcgiwrap looks like better, But i have 1 problem with it: > Here some code for the sript; > ---------------------------- > #!/usr/bin/python3 > > import os > environ = os.environ > serial = "unknown" > serial = environ["SERIAL"] > serial = serial.strip() > ... > http://server/cgi-bin/another_script.py?{serial} > --------------------------------------------------- > > My Problem is, that the call "another_script.py" does not have the > parameter "?{serial}". (i make a tcpdump from the interface) Has > somebody any idea, why it doesn´t go with fcgiwrap? > > It runs under Debian 12, python 3.12, nginx 1.26.2 . > > regards > Ralf > _______________________________________________ > nginx mailing list > nginx@nginx.org > https://mailman.nginx.org/mailman/listinfo/nginx >
_______________________________________________ nginx mailing list nginx@nginx.org https://mailman.nginx.org/mailman/listinfo/nginx