The CGI plugin provides the ability to run CGI scripts using the uWSGI server.

Web servers/clients/load balancers send requests to the uWSGI server using modifier 9. uWSGI then uses the variables passed from the client as CGI variables (on occasion fixing them) and calls the corresponding script/executable, re-forwarding its output to the client.

The plugin tries to resemble Apache’s behavior, allowing you to run CGI scripts even on webservers that do not support CGI natively, such as Nginx.

The cgi<[mountpoint=]path> option is the main entry point for configuring your CGI environment.

path may be a directory or an executable file.
In the case of a directory, the CGI plugin will use the URI to find the path of the script. If an executable is passed, it will be run, with SCRIPT_NAME, SCRIPT_FILENAME and PATH_INFO set in its environment.

The mountpoint is optional. You can use it to map different URIs to different CGI directories/scripts.

This is pretty much a full-stack solution using only uWSGI running on port 8080.

[uwsgi]plugins=http, cgi; bind on port 8080 and use the modifier 9http=:8080http-modifier1=9; set the document_root as a placeholdermy_document_root=/var/www; serve static files, skipping .pl and .cgi filescheck-static=%(my_document_root)static-skip-ext=.plstatic-skip-ext=.cgi; run cgi (ending in .pl or .cgi) in the document_rootcgi=%(my_document_root)cgi-index=index.plcgi-index=index.cgicgi-allowed-ext=.plcgi-allowed-ext=.cgi