From: Stefan Eissing Date: Wed, 9 Mar 2016 13:41:16 +0000 (+0000) Subject: mod_proxy_http2 documentation, addition of request notes proxy-status and proxy-sourc... X-Git-Tag: 2.5.0-alpha~1938 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=096bc816ac439c86c3360a98af95a2b74647ef7b;p=thirdparty%2Fapache%2Fhttpd.git mod_proxy_http2 documentation, addition of request notes proxy-status and proxy-source-port git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1734238 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/docs/manual/mod/mod_proxy_http2.xml b/docs/manual/mod/mod_proxy_http2.xml new file mode 100644 index 00000000000..1a505689758 --- /dev/null +++ b/docs/manual/mod/mod_proxy_http2.xml @@ -0,0 +1,83 @@ + + + + + + + + + +mod_proxy_http2 +HTTP/2 support module for +mod_proxy +Extension +mod_proxy_http2.c +proxy_http2_module + + +

This module requires the service of mod_proxy. It provides the features used for + proxying HTTP/2 requests. mod_proxy_http2 + supports HTTP/2 only. It does not + provide any downgrades to HTTP/1.1.

+ +

Thus, in order to get the ability of handling HTTP/2 proxy requests, + mod_proxy and mod_proxy_http2 + have to be present in the server.

+ +

mod_proxy_http2 works with incoming requests + over HTTP/1.1 and HTTP/2 requests. If mod_proxy_http2 + handles the frontend connection, requests against the same HTTP/2 + backend are sent over a single connection, whenever possible.

+ +

This module relies on libnghttp2 + to provide the core http/2 engine.

+ + Warning +

This module is experimental. Its behaviors, directives, and + defaults are subject to more change from release to + release relative to other standard modules. Users are encouraged to + consult the "CHANGES" file for potential updates.

+
+ + Warning +

Do not enable proxying until you have secured your server. Open proxy + servers are dangerous both to your network and to the Internet at + large.

+
+
+mod_http2 +mod_proxy +mod_proxy_connect + +
Request notes +

mod_proxy_http creates the following request notes for + logging using the %{VARNAME}n format in + LogFormat or + ErrorLogFormat: +

+
+
proxy-source-port
+
The local port used for the connection to the backend server.
+
proxy-status
+
The HTTP/2 status received from the backend server.
+
+
+ +
diff --git a/modules/http2/h2_proxy_session.c b/modules/http2/h2_proxy_session.c index 217b36410a0..307a9ca78ae 100644 --- a/modules/http2/h2_proxy_session.c +++ b/modules/http2/h2_proxy_session.c @@ -225,8 +225,9 @@ static apr_status_t h2_proxy_stream_add_header_out(h2_proxy_stream *stream, { if (n[0] == ':') { if (!stream->data_received && !strncmp(":status", n, nlen)) { - char *s = apr_pstrndup(stream->pool, v, vlen); + char *s = apr_pstrndup(stream->r->pool, v, vlen); + apr_table_setn(stream->r->notes, "proxy-status", s); ap_log_cerror(APLOG_MARK, APLOG_TRACE2, 0, stream->session->c, "h2_proxy_stream(%s-%d): got status %s", stream->session->id, stream->id, s); diff --git a/modules/http2/mod_proxy_http2.c b/modules/http2/mod_proxy_http2.c index ab1bb09d2e8..dcc6422b946 100644 --- a/modules/http2/mod_proxy_http2.c +++ b/modules/http2/mod_proxy_http2.c @@ -226,6 +226,8 @@ static apr_status_t add_request(h2_proxy_session *session, request_rec *r) apr_status_t status; url = apr_table_get(r->notes, H2_PROXY_REQ_URL_NOTE); + apr_table_setn(r->notes, "proxy-source-port", apr_psprintf(r->pool, "%hu", + ctx->p_conn->connection->local_addr->port)); status = h2_proxy_session_submit(session, url, r); if (status != OK) { ap_log_cerror(APLOG_MARK, APLOG_ERR, status, r->connection, APLOGNO(03351)