#
2139:99d792169ffb |
| 16-Jun-2022 |
Andrew Clayton |
Constified numerous function parameters.
As was pointed out by the cppcheck[0] static code analysis utility we can mark numerous function parameters as 'const'. This acts as a hint to the compiler a
Constified numerous function parameters.
As was pointed out by the cppcheck[0] static code analysis utility we can mark numerous function parameters as 'const'. This acts as a hint to the compiler about our intentions and the compiler will tell us when we deviate from them.
[0]: https://cppcheck.sourceforge.io/
show more ...
|
#
2133:46433e3cef45 |
| 20-Jun-2022 |
Zhidao HONG |
Router: forwared header replacement.
|
#
2132:34d63ed988dc |
| 20-Jun-2022 |
Zhidao HONG |
Router: introduced nxt_http_forward_t.
This makes the replacement of forwarded request header like client_ip and protocol more generic. It's a prerequirement for protocol replacement.
No functional
Router: introduced nxt_http_forward_t.
This makes the replacement of forwarded request header like client_ip and protocol more generic. It's a prerequirement for protocol replacement.
No functional changes.
show more ...
|
#
2123:36000da0aa5b |
| 19-May-2022 |
Zhidao HONG |
HTTP: generalized uri encoding.
No functional changes.
|
Revision tags: 1.27.0-1, 1.27.0 |
|
#
2104:2ae3c205fcad |
| 18-May-2022 |
Zhidao HONG |
HTTP: generalized argument and cookie parsing.
No functional changes.
|
Revision tags: 1.26.1-1, 1.26.1, 1.26.0-1, 1.26.0 |
|
#
1954:8f18a05d4c58 |
| 07-Sep-2021 |
Zhidao HONG |
Router: refactored variable pass.
Since the "pass" option supports both strings and variables, a generic nxt_var_t structure can be used in the configuration phase, and the "name" field in actions i
Router: refactored variable pass.
Since the "pass" option supports both strings and variables, a generic nxt_var_t structure can be used in the configuration phase, and the "name" field in actions is redundant.
No functional changes.
show more ...
|
Revision tags: 1.25.0-1, 1.25.0 |
|
#
1936:953434450ea9 |
| 12-Aug-2021 |
Oisin Canty |
Router: client IP address replacement.
This commit introduces the replacement of the client address based on the value of a specified HTTP header. This is intended for use when Unit is placed behin
Router: client IP address replacement.
This commit introduces the replacement of the client address based on the value of a specified HTTP header. This is intended for use when Unit is placed behind a reverse proxy like nginx or a CDN.
You must specify the source addresses of the trusted proxies. This can be accomplished with any valid IP pattern supported by Unit's match block:
["10.0.0.1", "10.4.0.0/16", "!192.168.1.1"]
The feature is configured per listener.
The client address replacement functionality only operates when there is a source IP match and the specified header is present. Typically this would be an 'X-Forwarded-For' header.
{ "listeners": { "127.0.0.1:8080": { "client_ip": { "header": "X-Forwarded-For", "source": [ "10.0.0.0/8" ] }, "pass": "applications/my_app" }, } }
If a request occurs and Unit receives a header like below:
"X-Forwarded-For: 84.123.23.23"
By default, Unit trusts the last rightmost IP in the header, so REMOTE_ADDR will be set to 84.123.23.23 if the connection originated from 10.0.0.0/8.
If Unit runs behind consecutive reverse proxies and receives a header similar to the following:
"X-Forwarded-For: 84.123.23.23, 10.0.0.254"
You will need to enable "recursive" checking, which walks the header from last address to first and chooses the first non-trusted address it finds.
{ "listeners": { "127.0.0.1:8080": { "client_ip": { "header": "X-Forwarded-For", "source": [ "10.0.0.0/8" ] "recursive": true, }, "pass": "applications/my_app" }, } }
If a connection from 10.0.0.0/8 occurs, the chain is walked. Here, 10.0.0.254 is also a trusted address so the client address will be replaced with 84.123.23.23.
If all IP addresses in the header are trusted, the client address is set to the first address in the header:
If 10.0.0.0/8 is trusted and "X-Forwarded-For: 10.0.0.3, 10.0.0.2, 10.0.0.1", the client address will be replaced with 10.0.0.3.
show more ...
|
#
1925:b8a2ac618950 |
| 24-Jul-2021 |
Zhidao HONG |
Router: split nxt_http_app_conf_t from nxt_http_action_t.
No functional changes.
|
Revision tags: 1.24.0-1, 1.24.0 |
|
#
1854:aebe76640568 |
| 22-Apr-2021 |
Zhidao HONG |
Router: grouped app and share fields in nxt_http_action_t.
This is a prerequisite for further introduction of openat2() features. No functional changes.
|
Revision tags: 1.23.0-1, 1.23.0, 1.22.0-1, 1.22.0, 1.21.0-1, 1.21.0 |
|
#
1656:6ba2bd9d7ee7 |
| 26-Oct-2020 |
Valentin Bartenev |
Increased request memory pool size.
Previous value was too small, which reduced efficiency of the pool causing a lot of additional allocations even for simple request and response.
|
Revision tags: 1.20.0-1, 1.20.0, 1.19.0-1, 1.19.0 |
|
#
1563:d32bc428f46b |
| 12-Aug-2020 |
Valentin Bartenev |
Basic variables support.
|
Revision tags: 1.18.0-1, 1.18.0 |
|
#
1473:e07d5b451423 |
| 14-May-2020 |
Valentin Bartenev |
PHP: implemented "targets" option.
This allows to specify multiple subsequent targets inside PHP applications. For example:
{ "listeners": { "*:80": { "pass": "route
PHP: implemented "targets" option.
This allows to specify multiple subsequent targets inside PHP applications. For example:
{ "listeners": { "*:80": { "pass": "routes" } },
"routes": [ { "match": { "uri": "/info" },
"action": { "pass": "applications/my_app/phpinfo" } }, { "match": { "uri": "/hello" },
"action": { "pass": "applications/my_app/hello" } }, { "action": { "pass": "applications/my_app/rest" } } ],
"applications": { "my_app": { "type": "php", "targets": { "phpinfo": { "script": "phpinfo.php", "root": "/www/data/admin", },
"hello": { "script": "hello.php", "root": "/www/data/test", },
"rest": { "root": "/www/data/example.com", "index": "index.php" }, } } } }
show more ...
|
Revision tags: 1.17.0-1, 1.17.0 |
|
#
1459:358b957ca294 |
| 16-Apr-2020 |
Max Romanov |
Using malloc/free for the http fields hash.
This is required due to lack of a graceful shutdown: there is a small gap between the runtime's memory pool release and router process's exit. Thus, a wor
Using malloc/free for the http fields hash.
This is required due to lack of a graceful shutdown: there is a small gap between the runtime's memory pool release and router process's exit. Thus, a worker thread may start processing a request between these two operations, which may result in an http fields hash access and subsequent crash.
To simplify issue reproduction, it makes sense to add a 2 sec sleep before exit() in nxt_runtime_exit().
show more ...
|
Revision tags: 1.16.0-1, 1.16.0 |
|
#
1403:1cee885b7f10 |
| 12-Mar-2020 |
Max Romanov |
Using disk file to store large request body.
This closes #386 on GitHub.
|
#
1402:6b8d8a11ff4f |
| 12-Mar-2020 |
Max Romanov |
Moving request memory pool retain call after RPC data allocation.
If the call is done only after a successful RPC data allocation, its corresponding release call is not missed, which avoids a potent
Moving request memory pool retain call after RPC data allocation.
If the call is done only after a successful RPC data allocation, its corresponding release call is not missed, which avoids a potential leak.
show more ...
|
#
1401:c88f739aac1c |
| 12-Mar-2020 |
Max Romanov |
Checking Content-Length value right after header parse.
The check was moved from the request body read stage.
|
Revision tags: 1.15.0-1, 1.15.0, 1.14.0-1, 1.14.0, 1.13.0-1, 1.13.0 |
|
#
1270:9efa309be18b |
| 14-Nov-2019 |
Igor Sysoev |
Initial proxy support.
|
#
1269:41331471eee7 |
| 14-Nov-2019 |
Igor Sysoev |
Introduced chained buffer completion handlers.
|
#
1265:01b50813093d |
| 14-Nov-2019 |
Igor Sysoev |
Using request task.
|
#
1264:30b289d97479 |
| 14-Nov-2019 |
Igor Sysoev |
Replacing pass with action.
|
Revision tags: 1.12.0-1, 1.12.0, 1.11.0-2, 1.11.0-1, 1.11.0 |
|
#
1183:6008abf06746 |
| 18-Sep-2019 |
Valentin Bartenev |
Basic support for serving static files.
|
#
1148:f93deb2432da |
| 26-Aug-2019 |
Igor Sysoev |
Adding body handler to nxt_http_request_header_send().
|
Revision tags: 1.10.0-2, 1.10.0-1, 1.10.0 |
|
#
1131:ec7d924d8dfb |
| 20-Aug-2019 |
Max Romanov |
Introducing websocket support in router and libunit.
|
#
1112:18c32043ae2e |
| 06-Aug-2019 |
Igor Sysoev |
Refactored HTTP protocol callback table.
|
#
1110:4ca6df50b4d4 |
| 24-Jul-2019 |
Axel Duch |
Added routing based on request scheme.
Scheme matches exact string “http” or “https”.
|