echo_duplicate
The `echo_duplicate` directive outputs the specified string multiple times to the response.
说明
The echo_duplicate directive from the NGINX Echo module allows you to send a string output multiple times in a response. This directive can accept two or more arguments, where each argument must be a string specifying the content to be echoed. The directive processes these strings and appends each to the output, effectively duplicating the provided strings in the response body.
When configured within a location or if in location block, the echo_duplicate directive is executed during the request processing phase, and it directly writes to the response based on NGINX's internal event loop. For instance, if you specify `echo_duplicate
配置示例
location /duplicate {
echo_duplicate "This is repeated!" "And again!";
}Make sure to provide at least two arguments, as the directive requires a minimum of two strings for duplication.
Ensure that string arguments are properly quoted if they contain spaces or special characters.
The output will not add line breaks by default unless explicitly included in the strings.