void handleProxyRequest(HttpClientRequest proxyRequest) {
        log.info("Connected to origin. Trace: {}. Span: {}. Project: {}. Deployment: {}. Address: {}",
                context.getTraceId(), context.getSpanId(),
                context.getProject(), context.getDeployment().getName(),
                proxyRequest.connection().remoteAddress());

        HttpServerRequest request = context.getRequest();
        context.setProxyRequest(proxyRequest);
        context.setProxyConnectTimestamp(System.currentTimeMillis());

        Deployment deployment = context.getDeployment();
        MultiMap excludeHeaders = MultiMap.caseInsensitiveMultiMap();
        if (!deployment.isForwardAuthToken()) {
            excludeHeaders.add(HttpHeaders.AUTHORIZATION, "whatever");
        }
        excludeHeaders.add(HEADER_APPLICATION_PROPERTIES, "whatever");
        excludeHeaders.add(HEADER_APPLICATION_ID, "whatever");

        ProxyUtil.copyHeaders(request.headers(), proxyRequest.headers(), excludeHeaders);

        if ((deployment instanceof Application application && application.hasApplicationTypeSchemaId())) {
            try {
                proxyRequest.headers().add(HEADER_APPLICATION_ID, deployment.getName());
                ApplicationTypeSchemaUtils.consumeServerProperties(context.getConfig(), application, (properties, appendApplicationPropertiesHeader) -> {
                    if (appendApplicationPropertiesHeader) {
                        String propsString = ProxyUtil.MAPPER.writeValueAsString(properties);
                        proxyRequest.headers().add(HEADER_APPLICATION_PROPERTIES, propsString);
                    }
                });
            } catch (Throwable e) {
                throw new HttpException(HttpStatus.INTERNAL_SERVER_ERROR, "Failed to enrich request with application properties");
            }
        }

        ApiKeyData proxyApiKeyData = context.getProxyApiKeyData();
        proxyRequest.headers().add(Proxy.HEADER_API_KEY, proxyApiKeyData.getPerRequestKey());

        Buffer requestBody = context.getRequestBody();
        proxyRequest.putHeader(HttpHeaders.CONTENT_LENGTH, Integer.toString(requestBody.length()));
        context.getRequestHeaders().forEach(proxyRequest::putHeader);

        proxyRequest.send(requestBody)
                .onSuccess(this::handleProxyResponse)
                .onFailure(this::handleProxyRequestError);
    }
Called when proxy connected to the origin.
server/src/main/java/com/epam/aidial/core/server/controller/DeploymentFeatureController.java