uwsgi_param
The `uwsgi_param` directive defines parameters to be passed to the uWSGI server.
Description
The uwsgi_param directive is used to set parameters in the uWSGI protocol for requests forwarded to a uWSGI server. These parameters can help configure the request environment variables available to the application running on the uWSGI server. The directive accepts two to three arguments: the first must be the parameter name, the second is the value, and an optional third can be provided to indicate whether to pass the original server variable or not. This flexibility aids in customizing the request handling based on specific application requirements.
When defining a uwsgi_param, it is crucial to understand that the parameters are case-sensitive and should match the expected values in your uWSGI application. Additionally, these definitions can be set within various contexts such as http, server, and location blocks, providing granular control over how different parts of your application interact with the uWSGI server. The values set through uwsgi_param may influence behaviors such as routing, logging, or rendering responses, depending on the application logic defined in the uWSGI application itself.
Config Example
location /app {
include uwsgi_params;
uwsgi_pass unix:/tmp/uwsgi.sock;
uwsgi_param SCRIPT_NAME /app;
uwsgi_param YOUR_CUSTOM_PARAM value;
}Ensure the parameter names match expected values in the uWSGI application; they are case-sensitive.
Using unnecessary parameters may lead to performance overhead or unexpected behavior.
Not all parameters may be relevant depending on the uWSGI application setup, so understand your application context.