code: public static void sendAndCloseNoEntityBodyResp(ChannelHandlerContext ctx, HttpResponseStatus status,
              HttpVersion httpVersion, String serverName) {
          HttpResponse outboundResponse = new DefaultHttpResponse(httpVersion, status);
          outboundResponse.headers().set(HttpHeaderNames.CONTENT_LENGTH, 0);
          outboundResponse.headers().set(HttpHeaderNames.CONNECTION.toString(), Constants.CONNECTION_CLOSE);
          outboundResponse.headers().set(HttpHeaderNames.SERVER.toString(), serverName);
          ChannelFuture outboundRespFuture = ctx.channel().writeAndFlush(outboundResponse);
          outboundRespFuture.addListener(
                  (ChannelFutureListener) channelFuture -> LOG.warn("Failed to send {}", status.reasonPhrase()));
          ctx.channel().close();
      }
docs: Send back no entity body response and close the connection. This function is mostly used
  when we send back error messages.
  
  @param ctx connection
  @param status response status
  @param httpVersion of the response
  @param serverName server name