summaryrefslogtreecommitdiffhomepage
path: root/src/http/modules/ngx_http_realip_module.c (follow)
AgeCommit message (Collapse)AuthorFilesLines
2022-05-30Reworked multi headers to use linked lists.Maxim Dounin1-4/+3
Multi headers are now using linked lists instead of arrays. Notably, the following fields were changed: r->headers_in.cookies (renamed to r->headers_in.cookie), r->headers_in.x_forwarded_for, r->headers_out.cache_control, r->headers_out.link, u->headers_in.cache_control u->headers_in.cookies (renamed to u->headers_in.set_cookie). The r->headers_in.cookies and u->headers_in.cookies fields were renamed to r->headers_in.cookie and u->headers_in.set_cookie to match header names. The ngx_http_parse_multi_header_lines() and ngx_http_parse_set_cookie_lines() functions were changed accordingly. With this change, multi headers are now essentially equivalent to normal headers, and following changes will further make them equivalent.
2019-10-21Core: moved PROXY protocol fields out of ngx_connection_t.Roman Arutyunyan1-4/+3
Now a new structure ngx_proxy_protocol_t holds these fields. This allows to add more PROXY protocol fields in the future without modifying the connection structure.
2017-08-01Variables: macros for null variables.Ruslan Ermilov1-1/+1
No functional changes.
2017-05-15Realip: allow hostnames in set_real_ip_from (ticket #1180).Ruslan Ermilov1-15/+68
2016-10-06Realip: fixed duplicate processing on redirects (ticket #1098).Maxim Dounin1-4/+4
Duplicate processing was possible if the address set by realip was listed in set_realip_from, and there was an internal redirect so module context was cleared. This resulted in exactly the same address being set, so this wasn't a problem before the $realip_remote_addr variable was introduced, though now results in incorrect $realip_remote_addr being picked. Fix is to use ngx_http_realip_get_module_ctx() to look up module context even if it was cleared. Additionally, the order of checks was switched to check the configuration first as it looks more effective.
2016-09-01Realip: fixed uninitialized memory access.Roman Arutyunyan1-1/+1
Previously, the realip module could be left with uninitialized context after an error in the ngx_http_realip_set_addr() function. That context could be later accessed by $realip_remote_addr and $realip_remote_port variable handlers.
2016-06-20Introduced ngx_inet_get_port() and ngx_inet_set_port() functions.Roman Arutyunyan1-37/+2
2016-05-23Realip: detect duplicate real_ip_header directive.Ruslan Ermilov1-0/+4
2016-05-23Realip: take client port from PROXY protocol header.Dmitry Volyntsev1-0/+22
Previously, when the client address was changed to the one from the PROXY protocol header, the client port ($remote_port) was reset to zero. Now the client port is also changed to the one from the PROXY protocol header.
2016-05-23Added the $realip_remote_port variable.Dmitry Volyntsev1-4/+71
2016-03-30Style.Ruslan Ermilov1-2/+2
2015-11-16Realip: the $realip_remote_addr variable.Ruslan Ermilov1-1/+71
2014-03-17Added server-side support for PROXY protocol v1 (ticket #355).Roman Arutyunyan1-0/+18
Client address specified in the PROXY protocol header is now saved in the $proxy_protocol_addr variable and can be used in the realip module. This is currently not implemented for mail.
2013-07-11Core: extended ngx_sock_ntop() with socklen parameter.Vladimir Homutov1-1/+2
On Linux, sockaddr length is required to process unix socket addresses properly due to unnamed sockets (which don't have sun_path set at all) and abstract namespace sockets.
2013-02-27Correctly handle multiple X-Forwarded-For headers (ticket #106).Ruslan Ermilov1-12/+13
2012-05-14realip: chains of trusted proxies and IPv6 support.Ruslan Ermilov1-93/+45
The module now supports recursive search of client address through the chain of trusted proxies, controlled by the "real_ip_recursive" directive (closes #2). It also gets full IPv6 support (closes #44) and canonical value of the $client_addr variable on address change. Example: real_ip_header X-Forwarded-For; set_real_ip_from 127.0.0.0/8; set_real_ip_from ::1; set_real_ip_from unix:; real_ip_recursive on;
2012-03-28Replaced ngx_http_realip_from_t with ngx_in_cidr_t.Ruslan Ermilov1-10/+4
2012-01-18Copyright updated.Maxim Konovalov1-0/+1
2009-11-11fix "set_real_ip_from unix:" inheritanceIgor Sysoev1-4/+9
2009-11-04allow to work single "set_real_ip_from unix:"Igor Sysoev1-1/+6
2009-11-03fix directive name in error message: "set_realip_from" to "set_real_ip_from"Igor Sysoev1-1/+1
2009-11-03fix directive name in error message: "realip_from" to "set_realip_from"Igor Sysoev1-1/+1
2009-11-02set_real_ip_from unix:Igor Sysoev1-51/+86
2009-11-02support IPv6 addresses in Real IP headersIgor Sysoev1-14/+20
2009-11-02replace inet_addr() with ngx_inet_addr()Igor Sysoev1-1/+1
2009-06-02return NULL instead of NGX_CONF_ERROR on a create conf failureIgor Sysoev1-1/+1
2009-02-24prepare ngx_ptocidr() for IPv6Igor Sysoev1-4/+10
2009-02-21a prelimiary IPv6 support, HTTP listenIgor Sysoev1-2/+4
2008-09-25real_ip_header supports any headerIgor Sysoev1-20/+101
2008-08-26*) refactor ngx_ptocidr()Igor Sysoev1-8/+0
*) allow address without bitmask *) thus now ngx_http_geo_module accepts addresses without bitmask
2008-08-13restore connection address on request closure,Igor Sysoev1-14/+57
this fixes the issue when a frontend before nginx sends various client connections via keepalive connection to nginx
2008-06-17*) back out r2040Igor Sysoev1-1/+1
*) refactor ngx_palloc() *) introduce ngx_pnalloc() *) additional pool blocks have smaller header
2007-08-10ignore meaningless bits in CIDR and warn about themIgor Sysoev1-1/+9
2007-02-17a client address must be allocated from a connection poolIgor Sysoev1-1/+8
to live through the keep-alive requests
2007-02-15fix broken values, debug logging, and style fixIgor Sysoev1-9/+19
2007-01-07ngx_http_realip_module must return NGX_DECLINEDIgor Sysoev1-6/+6
2006-08-30nginx-0.4.0-RELEASE importrelease-0.4.0Igor Sysoev1-5/+5
*) Change in internal API: the HTTP modules initialization was moved from the init module phase to the HTTP postconfiguration phase. *) Change: now the request body is not read beforehand for the ngx_http_perl_module: it's required to start the reading using the $r->has_request_body method. *) Feature: the ngx_http_perl_module supports the DECLINED return code. *) Feature: the ngx_http_dav_module supports the incoming "Date" header line for the PUT method. *) Feature: the "ssi" directive is available inside the "if" block. *) Bugfix: a segmentation fault occurred if there was an "index" directive with variables and the first index name was without variables; the bug had appeared in 0.1.29.
2006-07-28nginx-0.3.55-RELEASE importrelease-0.3.55Igor Sysoev1-1/+1
*) Feature: the "stub" parameter in the "include" SSI command. *) Feature: the "block" SSI command. *) Feature: the unicode2nginx script was added to contrib. *) Bugfix: if a "root" was specified by variable only, then the root was relative to a server prefix. *) Bugfix: if the request contained "//" or "/./" and escaped symbols after them, then the proxied request was sent unescaped. *) Bugfix: the $r->headers_in("Cookie") of the ngx_http_perl_module now returns all "Cookie" header lines. *) Bugfix: a segmentation fault occurred if "client_body_in_file_only on" was used and nginx switched to a next upstream. *) Bugfix: on some condition while reconfiguration character codes inside the "charset_map" may be treated invalid; the bug had appeared in 0.3.50.
2006-07-07nginx-0.3.53-RELEASE importrelease-0.3.53Igor Sysoev1-1/+1
*) Change: the "add_header" directive adds the string to 204, 301, and 302 responses. *) Feature: the "server" directive in the "upstream" context supports the "weight" parameter. *) Feature: the "server_name" directive supports the "*" wildcard. *) Feature: nginx supports the request body size more than 2G. *) Bugfix: if a client was successfully authorized using "satisfy_any on", then anyway the message "access forbidden by rule" was written in the log. *) Bugfix: the "PUT" method may erroneously not create a file and return the 409 code. *) Bugfix: if the IMAP/POP3 backend returned an error, then nginx continued proxying anyway.
2005-11-26nginx-0.3.12-RELEASE importrelease-0.3.12Igor Sysoev1-1/+1
*) Security: if nginx was built with the ngx_http_realip_module and the "satisfy_any on" directive was used, then access and authorization directives did not work. The ngx_http_realip_module was not built and is not built by default. *) Change: the "$time_gmt" variable name was changed to "$time_local". *) Change: the "proxy_header_buffer_size" and "fastcgi_header_buffer_size" directives was renamed to the "proxy_buffer_size" and "fastcgi_buffer_size" directives. *) Feature: the ngx_http_memcached_module. *) Feature: the "proxy_buffering" directive. *) Bugfix: the changes in accept mutex handling when the "rtsig" method was used; the bug had appeared in 0.3.0. *) Bugfix: if the client sent the "Transfer-Encoding: chunked" header line, then nginx returns the 411 error. *) Bugfix: if the "auth_basic" directive was inherited from the http level, then the realm in the "WWW-Authenticate" header line was without the "Basic realm" text. *) Bugfix: if the "combined" format was explicitly specified in the "access_log" directive, then the empty lines was written to the log; the bug had appeared in 0.3.8. *) Bugfix: nginx did not run on the sparc platform under any OS except Solaris. *) Bugfix: now it is not necessary to place space between the quoted string and closing bracket in the "if" directive.
2005-11-09nginx-0.3.8-RELEASE importrelease-0.3.8Igor Sysoev1-0/+275
*) Security: nginx now checks URI got from a backend in "X-Accel-Redirect" header line or in SSI file for the "/../" paths and zeroes. *) Change: nginx now does not treat the empty user name in the "Authorization" header line as valid one. *) Feature: the "ssl_session_timeout" directives of the ngx_http_ssl_module and ngx_imap_ssl_module. *) Feature: the "auth_http_header" directive of the ngx_imap_auth_http_module. *) Feature: the "add_header" directive. *) Feature: the ngx_http_realip_module. *) Feature: the new variables to use in the "log_format" directive: $bytes_sent, $apache_bytes_sent, $status, $time_gmt, $uri, $request_time, $request_length, $upstream_status, $upstream_response_time, $gzip_ratio, $uid_got, $uid_set, $connection, $pipe, and $msec. The parameters in the "%name" form will be canceled soon. *) Change: now the false variable values in the "if" directive are the empty string "" and string starting with "0". *) Bugfix: while using proxied or FastCGI-server nginx may leave connections and temporary files with client requests in open state. *) Bugfix: the worker processes did not flush the buffered logs on graceful exit. *) Bugfix: if the request URI was changes by the "rewrite" directive and the request was proxied in location given by regular expression, then the incorrect request was transferred to backend; the bug had appeared in 0.2.6. *) Bugfix: the "expires" directive did not remove the previous "Expires" header. *) Bugfix: nginx may stop to accept requests if the "rtsig" method and several worker processes were used. *) Bugfix: the "\"" and "\'" escape symbols were incorrectly handled in SSI commands. *) Bugfix: if the response was ended just after the SSI command and gzipping was used, then the response did not transferred complete or did not transferred at all.