uwsgi_ssl_session_reuse
The uwsgi_ssl_session_reuse directive controls SSL session reuse for uWSGI requests in NGINX.
Description
The uwsgi_ssl_session_reuse directive is used to enable or disable the reuse of SSL sessions for uWSGI requests that are proxied through NGINX. When enabled, this directive allows NGINX to use existing SSL session parameters for subsequent requests to the same backend server, reducing the SSL handshake overhead and improving performance.
This directive accepts a flag value, where on enables session reuse and off disables it. By default, this behavior is not set, meaning it respects the SSL session settings defined globally or at the server level. Under heavy loads, enabling SSL session reuse can lead to performance improvements, especially in environments where multiple requests are made to the same uWSGI backend in a short period of time, as it avoids the full SSL handshake for each request.
However, if the backend uWSGI server is not configured to handle or recognize SSL session reuse properly, it may lead to unexpected behavior. Thus, it is important to ensure that all parts of the system are configured similarly to handle reused SSL sessions appropriately. Additionally, testing the setup in a staging environment before deploying changes to production is advisable.
Config Example
uwsgi_pass unix:/var/run/uwsgi/your_app.sock; uwsgi_ssl_session_reuse on;
Ensure your backend uWSGI server supports SSL session reuse for proper functionality.
Using off may be necessary if there are issues with session handling on the backend.
Testing should be performed to validate performance improvements under expected load conditions.