Question: I want to have simple program in python that can process different requests (POST, GET, MULTIPART-FORMDATA). I don't want to use a complete framework.

I basically need to be able to get GET and POST params - probably (but not necessarily) in a way similar to PHP. To get some other SERVER variables like REQUEST\_URI, QUERY, etc.

I have installed nginx successfully, but I've failed to find a good example on how to do the rest. So a simple tutorial or any directions and ideas on how to setup nginx to run certain python process for certain virtual host would be most welcome!

Answer: 
Although you can make Python run a webserver by itself with [`wsgiref`](http://docs.python.org/library/wsgiref.html#examples), I would recommend using one of the many Python webservers and/or web frameworks around. For pure and simple Python webhosting we have several options available:

* [gunicorn](https://gunicorn.org/)
* [tornado](https://www.tornadoweb.org/en/stable/)
* [twisted](https://twisted.org/)
* [uwsgi](https://uwsgi-docs.readthedocs.io/en/latest/)
* [cherrypy](https://docs.cherrypy.dev/en/latest/)

If you're looking for more features you can look at some web frameworks:

* [werkzeug](https://werkzeug.palletsprojects.com/)
* [flask](https://flask.palletsprojects.com/)
* [masonite](https://docs.masoniteproject.com/)
* [cherrypy](https://docs.cherrypy.dev/en/latest/) (yes, cherrypy is both a webserver and a framework)
* [django](https://www.djangoproject.com/) (for completeness, I know that was not the purpose of the question)
You can use thttpd. It is a lightweight wsgi server for running cgi scripts. It works well with nginx. How to setup thttpd with Nginx is detailed here: <http://nginxlibrary.com/running-cgi-scripts-using-thttpd/>