summaryrefslogtreecommitdiffhomepage
path: root/src/stream/ngx_stream_proxy_module.c (follow)
AgeCommit message (Collapse)AuthorFilesLines
2017-05-26Introduced ngx_tcp_nodelay().Ruslan Ermilov1-16/+3
2017-04-18SSL: added support for TLSv1.3 in ssl_protocols directive.Sergey Kandaurov1-0/+1
Support for the TLSv1.3 protocol will be introduced in OpenSSL 1.1.1.
2017-01-11Stream: avoid infinite loop in case of socket read error.Vladimir Homutov1-2/+3
2016-12-26Stream: speed up TCP peer recovery.Roman Arutyunyan1-0/+5
Previously, an unavailable peer was considered recovered after a successful proxy session to this peer. Until then, only a single client connection per fail_timeout was allowed to be proxied to the peer. Since stream sessions can be long, it may take indefinite time for a peer to recover, limiting the ability of the peer to receive new connections. Now, a peer is considered recovered after a successful TCP connection is established to it. Balancers are notified of this event via the notify() callback.
2016-10-31Upstream: do not unnecessarily create per-request upstreams.Ruslan Ermilov1-17/+17
If proxy_pass (and friends) with variables evaluates an upstream specified with literal address, nginx always created a per-request upstream. Now, if there's a matching upstream specified in the configuration (either implicit or explicit), it will be used instead.
2016-10-31Upstream: added the ngx_http_upstream_resolved_t.name field.Ruslan Ermilov1-4/+2
This fixes inconsistency in what is stored in the "host" field. Normally it would contain the "host" part of the parsed URL (e.g., proxy_pass with variables), but for the case of an implicit upstream specified with literal address it contained the text representation of the socket address (that is, host including port for IP). Now the "host" field always contains the "host" part of the URL, while the text representation of the socket address is stored in the newly added "name" field. The ngx_http_upstream_create_round_robin_peer() function was modified accordingly in a way to be compatible with the code that does not know about the new "name" field. The "stream" code was similarly modified except for not adding compatibility in ngx_stream_upstream_create_round_robin_peer(). This change is also a prerequisite for the next change.
2016-10-31Upstream: removed unnecessary condition in proxy_eval() and friends.Ruslan Ermilov1-1/+1
The first condition added in d3454e719bbb should have just replaced the second one.
2016-10-19SSL: compatibility with BoringSSL.Maxim Dounin1-1/+2
BoringSSL changed SSL_set_tlsext_host_name() to be a real function with a (const char *) argument, so it now triggers a warning due to conversion from (u_char *). Added an explicit cast to silence the warning. Prodded by Piotr Sikora, Alessandro Ghedini.
2016-09-22Upstream: introduced u->upstream.Maxim Dounin1-0/+2
It holds upstream{} block configuration, including ones selected via run-time lookup using variables.
2016-09-15Stream: filters.Roman Arutyunyan1-78/+138
2016-09-02Stream: upstream response time variables.Vladimir Homutov1-0/+19
The $upstream_connect_time, $upstream_first_byte_time and $upstream_session_time variables keep corresponding times.
2016-09-02Stream: $upstream_bytes_sent and $upstream_bytes_received.Vladimir Homutov1-2/+12
2016-09-02Stream: the $upstream_addr variable.Vladimir Homutov1-0/+17
Keeps the full address of the upstream server. If several servers were contacted during proxying, their addresses are separated by commas, e.g. "192.168.1.1:80, 192.168.1.2:80".
2016-08-11Stream: the $status variable.Roman Arutyunyan1-37/+38
The stream session status is one of the following: 200 - normal completion 403 - access forbidden 500 - internal server error 502 - bad gateway 503 - limit conn
2016-07-26Stream: fixed build without stream_ssl_module (ticket #1032).Vladimir Homutov1-2/+2
2016-06-14Stream: variables in proxy_pass and proxy_ssl_name.Vladimir Homutov1-53/+323
2016-06-29Stream: got rid of pseudo variables.Vladimir Homutov1-29/+45
Stream limit_conn, upstream_hash and proxy modules now use complex values.
2016-06-15Stream: added preconfiguration step.Vladimir Homutov1-0/+1
2016-06-22Style.Roman Arutyunyan1-1/+0
2016-06-22Stream: use ngx_pcalloc() in ngx_stream_proxy_bind().Roman Arutyunyan1-1/+1
2016-06-20Stream: support for $remote_port in proxy_bind.Roman Arutyunyan1-9/+20
The following two types of bind addresses are supported in addition to $remote_addr and address literals: - $remote_addr:$remote_port - [$remote_addr]:$remote_port In both cases client remote address with port is used in upstream socket bind.
2016-06-20Upstream: support for port in proxy_bind and friends.Roman Arutyunyan1-1/+2
2016-06-20Introduced ngx_inet_get_port() and ngx_inet_set_port() functions.Roman Arutyunyan1-21/+3
2016-06-15SSL: ngx_ssl_ciphers() to set list of ciphers.Tim Taubert1-7/+1
This patch moves various OpenSSL-specific function calls into the OpenSSL module and introduces ngx_ssl_ciphers() to make nginx more crypto-library-agnostic.
2015-12-18Upstream: the "transparent" parameter of proxy_bind and friends.Roman Arutyunyan1-17/+86
This parameter lets binding the proxy connection to a non-local address. Upstream will see the connection as coming from that address. When used with $remote_addr, upstream will accept the connection from real client address. Example: proxy_bind $remote_addr transparent;
2016-04-13Stream: prepared proxy_bind to accept parameters.Roman Arutyunyan1-9/+48
2016-03-18Stream: additional logging for UDP.Vladimir Homutov1-2/+5
2016-01-20Stream: UDP proxy.Roman Arutyunyan1-26/+114
2016-03-15Stream: post first read events from client and upstream.Roman Arutyunyan1-12/+10
The main proxy function ngx_stream_proxy_process() can terminate the stream session. The code, following it, should check its return code to make sure the session still exists. This happens in client and upstream initialization functions. Swapping ngx_stream_proxy_process() call with the code, that follows it, leaves the same problem vice versa. In future ngx_stream_proxy_process() will call ngx_stream_proxy_next_upstream() making it too complicated to know if stream session still exists after this call. Now ngx_stream_proxy_process() is called from posted event handlers in both places with no code following it. The posted event is automatically removed once session is terminated.
2016-02-11Stream: initialize variable right before using it.Roman Arutyunyan1-2/+2
2016-02-11Stream: removed useless typedef.Roman Arutyunyan1-3/+0
2015-10-06Stream: delete proxy connection timer after SSL handshake.Ruslan Ermilov1-0/+4
The timer remained active and could drop active SSL connection.
2015-08-17Win32: MSVC 2015 compatibility.Maxim Dounin1-5/+5
Resolved warnings about declarations that hide previous local declarations. Warnings about WSASocketA() being deprecated resolved by explicit use of WSASocketW() instead of WSASocket(). When compiling without IPv6 support, WinSock deprecated warnings are disabled to allow use of gethostbyname().
2015-08-12Style.Vladimir Homutov1-1/+1
2015-08-10Stream: the "tcp_nodelay" directive.Vladimir Homutov1-2/+22
2015-07-30Stream: deprecated proxy_downstream_buffer, proxy_upstream_buffer.Roman Arutyunyan1-0/+23
The directive proxy_buffer_size should be used instead.
2015-07-29Style.Roman Arutyunyan1-2/+1
2015-07-29Stream: added proxy_buffer_size to set the size of data buffers.Roman Arutyunyan1-23/+11
Both download and upload buffers now have the same size. The old directives proxy_downstream_buffer and proxy_upstream_buffer are removed.
2015-07-14Stream: renamed rate limiting directives.Roman Arutyunyan1-14/+14
The directive proxy_downstream_limit_rate is now called proxy_upload_rate. The directive proxy_upstream_limit_rate is now called proxy_download_rate.
2015-07-02Stream: fixed possible integer overflow in rate limiting.Valentin Bartenev1-1/+1
2015-07-02Stream: fixed MSVC compilation warning.Roman Arutyunyan1-1/+1
Thanks to itpp2012.
2015-06-25Stream: upstream "connected" flag.Roman Arutyunyan1-3/+5
Once upstream is connected, the upstream buffer is allocated. Previously, the proxy module used the buffer allocation status to check if upstream is connected. Now it's enough to check the flag.
2015-06-23Stream: upstream and downstream limit rates.Roman Arutyunyan1-15/+110
2015-06-23Stream: common handler for upstream and downstream.Roman Arutyunyan1-25/+18
2015-06-16Stream: client-side PROXY protocol.Roman Arutyunyan1-2/+117
The new directive "proxy_protocol" toggles sending out PROXY protocol header to upstream once connection is established.
2015-06-16Stream: the "proxy_bind" directive.Vladimir Homutov1-0/+57
2015-06-09Stream: added postconfiguration method to stream modules.Vladimir Homutov1-0/+2
2015-05-25Disabled SSLv3 by default (ticket #653).Maxim Dounin1-3/+2
2015-04-22Stream: prevent repeated event notifications after eof.Roman Arutyunyan1-1/+4
When client or upstream connection is closed, level-triggered read event remained active until the end of the session leading to cpu hog. Now the flag NGX_CLOSE_EVENT is used to unschedule the event.
2015-04-20Stream: port from NGINX+.Ruslan Ermilov1-0/+1288