captcha_size
The 'captcha_size' directive defines the font size of the captcha text generated by the NGINX Captcha Module.
Description
The captcha_size directive is an important configuration option within the NGINX Captcha Module, enabling users to specify the size of the font used for rendering the captcha text in the generated images. This directive takes a single numeric argument that represents the desired font size in pixels. By adjusting the font size, administrators can enhance the readability of the captcha while also ensuring that it fits well within the dimensions of the captcha image. A larger font size can also improve accessibility for users with vision impairments.
Moreover, the captcha_size directive works in tandem with other directives such as captcha_height and captcha_width, which define the overall dimensions of the captcha image. It is crucial to set a font size that complements these dimensions, as a mismatch may result in a captcha that is difficult to read or that does not display properly. If not set appropriately, the font size may inadvertently lead to visual issues, affecting user experience when solving the captcha.
When configuring this directive, it is essential to be aware of the rendering capabilities of the underlying font, as some fonts may not scale well at certain sizes, potentially detracting from the captcha's aesthetic appeal. Testing various sizes in practice is recommended to find the ideal balance between security and usability.
Config Example
location =/captcha {
captcha;
captcha_size 30;
}Using a font size that is too large may cause the text to overflow outside the captcha image boundaries.
Not testing the captcha with various font sizes can lead to unexpected readability issues, particularly for users with vision impairments.