Differences between revisions 1 and 2
Revision 1 as of 2022-09-26 17:56:34
Size: 1401
Comment:
Revision 2 as of 2022-09-26 17:56:55
Size: 1441
Comment:
Deletions are marked like this. Additions are marked like this.
Line 35: Line 35:
uwsgi_param QUERY_STRING $query_string;
uwsgi_param REQUEST_METHOD $request_method;
uwsgi_param CONTENT_TYPE $content_type;
uwsgi_param CONTENT_LENGTH $content_length;
uwsgi_param REQUEST_URI $request_uri;
uwsgi_param PATH_INFO $document_uri;
uwsgi_param DOCUMENT_ROOT $document_root;
uwsgi_param QUERY_STRING    $query_string;
uwsgi_param REQUEST_METHOD  $request_method;
uwsgi_param CONTENT_TYPE    $content_type;
uwsgi_param CONTENT_LENGTH  $content_length;
uwsgi_param REQUEST_URI     $request_uri;
uwsgi_param PATH_INFO       $document_uri;
uwsgi_param DOCUMENT_ROOT   $document_root;
Line 43: Line 43:
uwsgi_param REMOTE_ADDR $remote_addr;
uwsgi_param REMOTE_PORT $remote_port;
uwsgi_param SERVER_ADDR $server_addr;
uwsgi_param SERVER_PORT $server_port;
uwsgi_param SERVER_NAME $server_name;
uwsgi_param REMOTE_ADDR     $remote_addr;
uwsgi_param REMOTE_PORT     $remote_port;
uwsgi_param SERVER_ADDR     $server_addr;
uwsgi_param SERVER_PORT     $server_port;
uwsgi_param SERVER_NAME     $server_name;

NGINX UWSGI

uwsgi is a WSGI server that is commonly used for Python projects.

See Python/UWSGI for details on installation, configuration, and usage of uwsgi.


Example

The minimal configuration of nginx(8) for uwsgi looks like:

location / {
    include /etc/nginx/uwsgi_params;
    uwsgi_pass 127.0.0.1:9000;
}

Many tutorials recommend adding uwsgi_modifier1 30, which will automatically rewrite PATH_INFO and SCRIPT_NAME. This is deprecated and unstable for Python 3.

Uwsgi_params

The uwsgi_params file mirrors the fastcgi_params file from FastCGI.

Here is a generic template, which would work for the above example.

uwsgi_param QUERY_STRING    $query_string;
uwsgi_param REQUEST_METHOD  $request_method;
uwsgi_param CONTENT_TYPE    $content_type;
uwsgi_param CONTENT_LENGTH  $content_length;
uwsgi_param REQUEST_URI     $request_uri;
uwsgi_param PATH_INFO       $document_uri;
uwsgi_param DOCUMENT_ROOT   $document_root;
uwsgi_param SERVER_PROTOCOL $server_protocol;
uwsgi_param REMOTE_ADDR     $remote_addr;
uwsgi_param REMOTE_PORT     $remote_port;
uwsgi_param SERVER_ADDR     $server_addr;
uwsgi_param SERVER_PORT     $server_port;
uwsgi_param SERVER_NAME     $server_name;


CategoryRicottone

Nginx/Uwsgi (last edited 2023-04-22 20:30:12 by DominicRicottone)