@Override
    public void channelInactive(ChannelHandlerContext ctx) throws Exception {
        if (edgeProxy != null) {
            logger.debug("Origin channel inactive. channel-info={}", ChannelUtils.channelInfoForLogging(ctx.channel()));
            OriginConnectException ex =
                    new OriginConnectException("Origin server inactive", OutboundErrorType.RESET_CONNECTION);
            edgeProxy.errorFromOrigin(ex);
        }
        super.channelInactive(ctx);
        ctx.close();
    }
Override to add custom pre-write functionality

@param ctx     channel handler context
@param zuulReq request message to modify
zuul-core/src/main/java/com/netflix/zuul/netty/server/OriginResponseReceiver.java