nginx and python script

Ralf Figge Ralf.Figge at bitmail.prima.de
Fri Dec 27 21:15:15 UTC 2024


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


More information about the nginx mailing list