Laravel same code generates picture CAPTCHA apache no problem nginx has a problem

uses Gregwar\ Captcha\ CaptchaBuilder the image verification code generated by this library. The following is the generated code:

$builder = new CaptchaBuilder;
$builder->build($width = 110, $height = 34, $font = null);

return response($builder->output())->header("Content-type", "image/jpeg");

in the local apache environment, the CAPTCHA can be seen in the browser with url, but garbled is returned on nginx. As shown in the figure:

I don"t know why the header message of the nginx response is test/html , and apache is the correct image/jpeg . The code is all the same.
excuse me, where is nginx? is there anything else that needs to be configured? Thank you

Mar.06,2021
Menu