UWSGI: Difference between revisions
Appearance
Inital page |
Add link and category |
||
Line 1: | Line 1: | ||
[https://github.com/unbit/uwsgi uWSGI] web application server for different programming languages such as Python, Perl or Ruby. Implementing the WSGI-protocol. | |||
== Setup == | == Setup == | ||
Line 34: | Line 34: | ||
}; | }; | ||
</syntaxhighlight>The application will be available on <code><nowiki>http://localhost</nowiki></code> . | </syntaxhighlight>The application will be available on <code><nowiki>http://localhost</nowiki></code>. | ||
[[Category:Server]] |
Latest revision as of 10:01, 24 August 2025
uWSGI web application server for different programming languages such as Python, Perl or Ruby. Implementing the WSGI-protocol.
Setup
Following example configuration illustrates how to serve the Python web app Oncall usgin the uWSGI module
services.uwsgi = {
enable = true;
plugins = [ "python3" ];
instance = {
type = "emperor";
vassals = {
oncall = {
type = "normal";
env = [
"PYTHONPATH=${pkgs.oncall.pythonPath}"
"STATIC_ROOT=/var/lib/oncall"
];
module = "oncall.app:get_wsgi_app()";
socket = "${config.services.uwsgi.runDir}/oncall.sock";
socketGroup = "nginx";
immediate-gid = "nginx";
chmod-socket = "770";
pyargv = "${pkgs.oncall}/share/configs/config.yaml";
buffer-size = 32768;
};
};
};
};
services.nginx = {
enable = lib.mkDefault true;
virtualHosts."localhost".locations = {
"/".extraConfig = "uwsgi_pass unix://${config.services.uwsgi.runDir}/oncall.sock;";
};
};
The application will be available on http://localhost
.