researchcloud-items

Installation scripts for SURF ResearchCloud catalog components

View the Project on GitHub UtrechtUniversity/researchcloud-items

Role nginx_uwsgi

back to index

Summary

Setup a Python webapp using uwsgi, using Nginx as a reverse proxy. Since this role utilises the nginx_reverse_proxy role, the webapp can be easily secured using SRAM authentication.

The uWSGI service translates HTTP requests into UWSGI protocol requests, suitable for consumption by for instance Python web applications.

The Python application is assumed to be installed already in the location uwsgi_app_dir/uwsgi_app_path.

Requires

Description

The role can be executed in two modes:

  1. (Default) Install uwsgi and its Python3 plugin via the system package manager (apt).
  2. Use a pre-existing uwsgi installation in a venv. To use this mode, set the uwsgi_venv variable to the location of venv already containing uwsgi.

A systemd service named uwsgi-<uwsgi_app_name> is created for the application, where <uwsgi_app_name> corresponds to the variable documented below. You can restart it with e.g. systemctl restart uwsgi-example.

Logs for the application will be written to /var/log/uwsgi/<app_name>.log and /var/log/uwsgi/<app_name>_err.log. Logrotation for these files is activated.

The nginx web server is used as a reverse proxy, using the reverse_proxy role. You can configure at which location the application should be served, and if authentication should be used, as per the documentation for that role (see variables below).

Variables

See also

History

2021-2024 Written by Ton Smeele and Dawa Ometto (Utrecht University)

back to index