uwsgi_ssl_verify

The `uwsgi_ssl_verify` directive configures SSL certificate verification for uWSGI requests in NGINX.

Syntaxuwsgi_ssl_verify on | off;
Defaultoff
Contexthttp, server, location
Argumentsflag

Description

In NGINX, the uwsgi_ssl_verify directive is used to enable or disable SSL verification when NGINX makes requests to a uWSGI server over SSL. This directive can take a boolean flag as an argument, indicating whether SSL certificate verification should be performed. When enabled, NGINX checks the SSL certificates presented by the uWSGI server to ensure they are valid and trusted, which helps in preventing man-in-the-middle attacks and ensuring secure communication.

This directive is often used in conjunction with uwsgi_pass, where requests are forwarded to a uWSGI backend that is configured to handle PHP applications, Python applications, or other frameworks that use the uWSGI protocol. It can be specified within the http, server, or location contexts, allowing for flexible configuration depending on the desired scope of SSL verification. The directive is especially important in production environments where secure communications are critical.

When the verification is enabled (on), NGINX also requires the appropriate certificate authority (CA) file or bundle to ascertain the validity of the server's SSL certificate. If it is set to off, NGINX will not verify the SSL certificate, which may leave the server vulnerable to spoofing attacks. Given its significance, this directive should be carefully configured according to the security needs of the application.

Config Example

uwsgi_ssl_verify on;
uwsgi_pass https://backend-uwsgi;

Ensure the CA file is correctly set up if enabling SSL verification.

Avoid setting it to 'off' in production environments as it compromises security.

Check the uWSGI server's SSL configuration if issues arise while enabling verification.

← Back to all directives