From vbart at nginx.com Fri Mar 1 17:01:03 2019 From: vbart at nginx.com (Valentin V. Bartenev) Date: Fri, 01 Mar 2019 20:01:03 +0300 Subject: Unit 1.8.0 release Message-ID: <1928316.PQb4FlHEg3@vbart-workstation> Hi, I'm glad to announce a new release of NGINX Unit. This release contains two big features that we have been working on diligently during the last months. Some of you wonder why listener sockets are separated from applications in Unit configuration API. That was done intentionally to introduce advanced routing between sockets and applications in the future, and this future is finally happening. Now you will be able to specify quite handy rules that will direct your requests to a particular application depending on various parameters. Please take a glance at the routing documentation: - https://unit.nginx.org/configuration/#routes Currently, it only supports internal routing by Host, URI, and method request parameters. In the following releases, available options are going to be expanded to allow matching arbitrary headers, arguments, cookies, source and destination addresses. We will also add regular expression patterns. In future releases, these routing abilities will be handy for issuing redirects and changing configuration on a per route basis. As usual with Unit, all routing changes are fully dynamic and gracefully done through its control API. The second feature is even bigger. We've merged the code that Maxim Romanov developed in a separate branch last year to support running applications leveraging certain technology described in the Java(tm) Servlet 3.1 (JSR-340) specification. This module is a BETA release as the module is untested and presumed incompatible with the JSR-340 specification. Now everybody can easily install it from our packages, try it with their Java applications, and leave us feedback. If you're a Jira user, please use this HowTo: - https://unit.nginx.org/howto/jira/ More documentation is available in Installation and Configuration sections: - https://unit.nginx.org/installation/ - https://unit.nginx.org/configuration/#java-application We intend to use our open-development process to refine and improve the software and to eventually test and certify the software's compatibility with the JSR-340 specification. Unless and until the software has been tested and certified, you should not deploy the software in support of deploying or providing Java Servlet 3.1 applications. You should instead deploy production applications on pre-built binaries that have been tested and certified to meet the JSR-340 compatibility requirements such as certified binaries published for the JSR-340 reference implementation available at https://javaee.github.io/glassfish/. * Java is a registered trademark of Oracle and/or its affiliates. Changes with Unit 1.8.0 01 Mar 2019 *) Change: now three numbers are always used for versioning: major, minor, and patch versions. *) Change: now QUERY_STRING is always defined even if the request does not include the query component. *) Feature: basic internal request routing by Host, URI, and method. *) Feature: experimental support for Java Servlet Containers. *) Bugfix: segmentation fault might have occurred in the router process. *) Bugfix: various potential memory leaks. *) Bugfix: TLS connections might have stalled. *) Bugfix: some Perl applications might have failed to send the response body. *) Bugfix: some compilers with specific flags might have produced non-functioning builds; the bug had appeared in 1.5. *) Bugfix: Node.js package had wrong version number when installed from sources. Our versioning scheme is actually always supposed to have the third version number, but the ".0" patch version was hidden. In order to avoid any possible confusion, it was decided to always show ".0" in version numbers. For those who are interested in running Unit on CentOS, Fedora, and RHEL with latest versions of PHP, the corresponding packages are now available in Remi's RPM repository: - https://unit.nginx.org/installation/#remi-s-rpm-repo Many kudos to Remi Collet for collaboration. Note also that our technical writer Artem Konev has recently added more HowTos to the site about configuring various applications, including WordPress, Flask, and Django-based ones: - https://unit.nginx.org/howto/ He will continue discovering and writing instructions for other applications. If you're interested in some specific use cases and applications, please don't hesitate to leave a feature request on the documentation GitHub: - https://github.com/nginx/unit-docs/issues In the following releases, we will continue improving routing capabilities and support for Java applications. Among other big features we're working on are WebSockets support and serving static media assets. Stay tuned, give feedback, and help us to create the best software ever. wbr, Valentin V. Bartenev From devnexen at gmail.com Sun Mar 3 20:26:56 2019 From: devnexen at gmail.com (David CARLIER) Date: Sun, 3 Mar 2019 20:26:56 +0000 Subject: [PATCH] SO_USER_COOKIE socket option support Message-ID: Hi, Here a little patch proposal to support this socket option. Kind regards. -------------- next part -------------- A non-text attachment was scrubbed... Name: unit-user_cookie.diff Type: application/octet-stream Size: 1213 bytes Desc: not available URL: From tarkhil at over.ru Mon Mar 4 09:34:52 2019 From: tarkhil at over.ru (=?UTF-8?B?0JDQu9C10LrRgdCw0L3QtNGAINCf0L7QstC+0LvQvtGG0LrQuNC5?=) Date: Mon, 4 Mar 2019 12:34:52 +0300 Subject: How do I restart an application? Message-ID: Hello Do I have any way to restart specific application in unit? Or I have to restart unitd at all? I think some command like 'apachectl graceful' should exist/ Alex From tarkhil at over.ru Mon Mar 4 11:25:15 2019 From: tarkhil at over.ru (=?UTF-8?B?0JDQu9C10LrRgdCw0L3QtNGAINCf0L7QstC+0LvQvtGG0LrQuNC5?=) Date: Mon, 4 Mar 2019 14:25:15 +0300 Subject: Two more problems with Mojolicious Message-ID: <96d3a915-6066-479e-fd3e-87bf86391907@over.ru> Hello 1. When I'm sending chunked content (I'm using some fairly long database requests, and cursor sending lines one by one is much better in term of both memory usage and response speed) is shown on client side with chunks' lenghts. 2. UTF-8 data gets double encoded. If you need, I'll make a short example. -- Alex From vbart at nginx.com Mon Mar 4 13:11:55 2019 From: vbart at nginx.com (Valentin V. Bartenev) Date: Mon, 04 Mar 2019 16:11:55 +0300 Subject: How do I restart an application? In-Reply-To: References: Message-ID: <3125563.xBhRTMPEmX@vbart-workstation> On Monday 04 March 2019 12:34:52 ????????? ?????????? wrote: > Hello > > Do I have any way to restart specific application in unit? Or I have to > restart unitd at all? I think some command like 'apachectl graceful' > should exist/ > [..] Currently the best way to restart an application is something like this: curl -X PUT -d "{\"gen\":\"$RANDOM\"}" \ --unix-socket /var/run/control.unit.sock \ /config/applications//environment The more straightforward API is planned, for example: curl --unix-socket /var/run/control.unit.sock \ /control/applications//restart wbr, Valentin V. Bartenev From tarkhil at over.ru Mon Mar 4 13:13:13 2019 From: tarkhil at over.ru (=?UTF-8?B?0JDQu9C10LrRgdCw0L3QtNGAINCf0L7QstC+0LvQvtGG0LrQuNC5?=) Date: Mon, 4 Mar 2019 16:13:13 +0300 Subject: How do I restart an application? In-Reply-To: <3125563.xBhRTMPEmX@vbart-workstation> References: <3125563.xBhRTMPEmX@vbart-workstation> Message-ID: <8eba1f48-d255-7dd0-e683-3576f06d79ec@over.ru> Sounds nice. I'd like also commands "restart" and "graceful" as different ones. On 04.03.2019 16:11, Valentin V. Bartenev wrote: > On Monday 04 March 2019 12:34:52 ????????? ?????????? wrote: >> Hello >> >> Do I have any way to restart specific application in unit? Or I have to >> restart unitd at all? I think some command like 'apachectl graceful' >> should exist/ >> > [..] > > Currently the best way to restart an application is something like this: > > curl -X PUT -d "{\"gen\":\"$RANDOM\"}" \ > --unix-socket /var/run/control.unit.sock \ > /config/applications//environment > > The more straightforward API is planned, for example: > > curl --unix-socket /var/run/control.unit.sock \ > /control/applications//restart > > > wbr, Valentin V. Bartenev > > _______________________________________________ > unit mailing list > unit at nginx.org > https://mailman.nginx.org/mailman/listinfo/unit From vbart at nginx.com Mon Mar 4 13:18:32 2019 From: vbart at nginx.com (Valentin V. Bartenev) Date: Mon, 04 Mar 2019 16:18:32 +0300 Subject: How do I restart an application? In-Reply-To: <8eba1f48-d255-7dd0-e683-3576f06d79ec@over.ru> References: <3125563.xBhRTMPEmX@vbart-workstation> <8eba1f48-d255-7dd0-e683-3576f06d79ec@over.ru> Message-ID: <6993084.N3UKvFbu0U@vbart-workstation> On Monday 04 March 2019 16:13:13 ????????? ?????????? wrote: > Sounds nice. I'd like also commands "restart" and "graceful" as > different ones. > [..] Thanks for suggestion. Noted. Probably: curl --unix-socket /var/run/control.unit.sock \ /control/applications//restart?graceful=false (graceful=true by default) wbr, Valentin V. Bartenev From vbart at nginx.com Mon Mar 4 14:12:14 2019 From: vbart at nginx.com (Valentin V. Bartenev) Date: Mon, 04 Mar 2019 17:12:14 +0300 Subject: Two more problems with Mojolicious In-Reply-To: <96d3a915-6066-479e-fd3e-87bf86391907@over.ru> References: <96d3a915-6066-479e-fd3e-87bf86391907@over.ru> Message-ID: <1791102.dx0yOBDKvk@vbart-workstation> On Monday 04 March 2019 14:25:15 ????????? ?????????? wrote: > Hello > > 1. When I'm sending chunked content (I'm using some fairly long database > requests, and cursor sending lines one by one is much better in term of > both memory usage and response speed) is shown on client side with > chunks' lenghts. HTTP and PSGI are different. There's not such thing as Chunked Transfer Encoding in PSGI. PSGI is specifically designed to abastract application from transport protocol, like HTTP/1.1. Thus application must not do any assumption about transport protocol, and must not issue any connection level HTTP headers, must not apply any trasfer encodings. All the body data output is interpreted as is (and this is required by PSGI specification). When PSGI application writing chunks with lengths, these chunks are wrapped into HTTP chunks (if allowed) by web server (Unit in this case) and then they are sent to client. As a result, you see exactly what the application outputs. The protocol can be HTTP/1.0 (where no chunked transfer encoding is possible), or HTTP/2 as well (where chunks have completely different representation as binary frames of data). If you want to send lines one by one, you should do this in the application just by writing these lines as is, Unit will do all the work for transferring the data with proper encoding for particular protocol (HTTP/1.0, HTTP/1.1, or HTTP/2, HTTP/3 in the future). > > 2. UTF-8 data gets double encoded. > > If you need, I'll make a short example. Do you mean UTF-8 data in headers or in body? Request or response? An example would be useful. wbr, Valentin V. Bartenev From tarkhil at over.ru Mon Mar 4 14:27:10 2019 From: tarkhil at over.ru (=?UTF-8?B?0JDQu9C10LrRgdCw0L3QtNGAINCf0L7QstC+0LvQvtGG0LrQuNC5?=) Date: Mon, 4 Mar 2019 17:27:10 +0300 Subject: Two more problems with Mojolicious In-Reply-To: <1791102.dx0yOBDKvk@vbart-workstation> References: <96d3a915-6066-479e-fd3e-87bf86391907@over.ru> <1791102.dx0yOBDKvk@vbart-workstation> Message-ID: <0984a907-4e7a-036d-c41b-4f1a18f374d5@over.ru> I mean reply, body. Well, I thought that my application does not do any assumption, but write_chunk seems to be not portable. So I need to patch Mojolicious to determine PSGI, HTTP/1.1 and HTTP/2 and write data properly, or in my app use write instead of write_chunk? And the problem with double encoding concerns me even more. Looks like either PSGI in Mojolicious is broken, or Mojo and unit just speaks different dialects... On 04.03.2019 17:12, Valentin V. Bartenev wrote: > On Monday 04 March 2019 14:25:15 ????????? ?????????? wrote: >> Hello >> >> 1. When I'm sending chunked content (I'm using some fairly long database >> requests, and cursor sending lines one by one is much better in term of >> both memory usage and response speed) is shown on client side with >> chunks' lenghts. > HTTP and PSGI are different. > > There's not such thing as Chunked Transfer Encoding in PSGI. > PSGI is specifically designed to abastract application from > transport protocol, like HTTP/1.1. > > Thus application must not do any assumption about transport > protocol, and must not issue any connection level HTTP headers, > must not apply any trasfer encodings. All the body data output > is interpreted as is (and this is required by PSGI specification). > > When PSGI application writing chunks with lengths, these chunks > are wrapped into HTTP chunks (if allowed) by web server (Unit in > this case) and then they are sent to client. As a result, you > see exactly what the application outputs. > > The protocol can be HTTP/1.0 (where no chunked transfer encoding > is possible), or HTTP/2 as well (where chunks have completely > different representation as binary frames of data). > > If you want to send lines one by one, you should do this in the > application just by writing these lines as is, Unit will do all > the work for transferring the data with proper encoding for > particular protocol (HTTP/1.0, HTTP/1.1, or HTTP/2, HTTP/3 in > the future). > > > >> 2. UTF-8 data gets double encoded. >> >> If you need, I'll make a short example. > Do you mean UTF-8 data in headers or in body? > Request or response? > > An example would be useful. > > wbr, Valentin V. Bartenev > > _______________________________________________ > unit mailing list > unit at nginx.org > https://mailman.nginx.org/mailman/listinfo/unit From vbart at nginx.com Mon Mar 4 15:34:52 2019 From: vbart at nginx.com (Valentin V. Bartenev) Date: Mon, 04 Mar 2019 18:34:52 +0300 Subject: Two more problems with Mojolicious In-Reply-To: <0984a907-4e7a-036d-c41b-4f1a18f374d5@over.ru> References: <96d3a915-6066-479e-fd3e-87bf86391907@over.ru> <1791102.dx0yOBDKvk@vbart-workstation> <0984a907-4e7a-036d-c41b-4f1a18f374d5@over.ru> Message-ID: <4108482.xz0uNoKtpf@vbart-workstation> On Monday 04 March 2019 17:27:10 ????????? ?????????? wrote: > I mean reply, body. > > Well, I thought that my application does not do any assumption, but > write_chunk seems to be not portable. So I need to patch Mojolicious to > determine PSGI, HTTP/1.1 and HTTP/2 and write data properly, or in my > app use write instead of write_chunk? Indeed, write_chunk() function doesn't look portable at all. It looks like that it even doesn't check if a client supports chunked transfer encoding (i.e. speaks HTTP/1.1) when working over HTTP: sub write_chunk { my ($self, $chunk, $cb) = @_; $self->headers->transfer_encoding('chunked') unless $self->is_chunked; $self->write(defined $chunk ? $self->_build_chunk($chunk) : $chunk, $cb); $self->{eof} = 1 if defined $chunk && !length $chunk; return $self; } sub _build_chunk { my ($self, $chunk) = @_; # End return "\x0d\x0a0\x0d\x0a\x0d\x0a" unless length $chunk; # First chunk has no leading CRLF my $crlf = $self->{chunks}++ ? "\x0d\x0a" : ''; return $crlf . sprintf('%x', length $chunk) . "\x0d\x0a$chunk"; } You can just use write() with Unit. > > And the problem with double encoding concerns me even more. Looks like > either PSGI in Mojolicious is broken, or Mojo and unit just speaks > different dialects... > We'll try to reproduce and look what happens in this case. But from the code above, it seems Mojo authors don't care much about protocols other than particular version of HTTP/1.1. wbr, Valentin V. Bartenev From alexander.borisov at nginx.com Mon Mar 4 16:03:08 2019 From: alexander.borisov at nginx.com (Alexander Borisov) Date: Mon, 4 Mar 2019 19:03:08 +0300 Subject: Two more problems with Mojolicious In-Reply-To: <96d3a915-6066-479e-fd3e-87bf86391907@over.ru> References: <96d3a915-6066-479e-fd3e-87bf86391907@over.ru> Message-ID: <1E2F0364-6545-43EC-87B1-4FC49D62F8CD@nginx.com> Hello Alexander, > 4 ????? 2019 ?., ? 14:25, ????????? ?????????? ???????(?): > > Hello > > 1. When I'm sending chunked content (I'm using some fairly long database requests, and cursor sending lines one by one is much better in term of both memory usage and response speed) is shown on client side with chunks' lenghts. > > 2. UTF-8 data gets double encoded. I tried this example: use Mojolicious::Lite; use Devel::StackTrace; get '/' => sub { my $c = shift; $c->render(text => '??????'); }; app->start; Works fine for me. > GET / HTTP/1.1 > Host: localhost:8500 > User-Agent: curl/7.54.0 > Accept: */* > < HTTP/1.1 200 OK < Date: Mon, 04 Mar 2019 15:51:50 GMT < Content-Type: text/html;charset=UTF-8 < Content-Length: 12 < Server: Unit/1.8.0 < * Connection #0 to host localhost left intact ?????? > > If you need, I'll make a short example. > > -- > > Alex > > _______________________________________________ > unit mailing list > unit at nginx.org > https://mailman.nginx.org/mailman/listinfo/unit -------------- next part -------------- An HTML attachment was scrubbed... URL: From tarkhil at over.ru Mon Mar 4 16:06:16 2019 From: tarkhil at over.ru (=?UTF-8?B?0JDQu9C10LrRgdCw0L3QtNGAINCf0L7QstC+0LvQvtGG0LrQuNC5?=) Date: Mon, 4 Mar 2019 19:06:16 +0300 Subject: Two more problems with Mojolicious In-Reply-To: <1E2F0364-6545-43EC-87B1-4FC49D62F8CD@nginx.com> References: <96d3a915-6066-479e-fd3e-87bf86391907@over.ru> <1E2F0364-6545-43EC-87B1-4FC49D62F8CD@nginx.com> Message-ID: My program outputs JSON. decode_json works fine with HTTP, to_json is required for PSGI. On 04.03.2019 19:03, Alexander Borisov wrote: > Hello Alexander, > >> 4 ????? 2019 ?., ? 14:25, ????????? ?????????? > > ???????(?): >> >> Hello >> >> 1. When I'm sending chunked content (I'm using some fairly long >> database requests, and cursor sending lines one by one is much better >> in term of both memory usage and response speed) is shown on client >> side with chunks' lenghts. >> >> 2. UTF-8 data gets double encoded. > > I tried this example: > use Mojolicious::Lite; > use Devel::StackTrace; > get '/' => sub { > my $c = shift; > $c->render(text => '??????'); > }; > app->start; > > Works fine for me. > > > GET / HTTP/1.1 > > Host: localhost:8500 > > User-Agent: curl/7.54.0 > > Accept: */* > > > < HTTP/1.1 200 OK > < Date: Mon, 04 Mar 2019 15:51:50 GMT > < Content-Type: text/html;charset=UTF-8 > < Content-Length: 12 > < Server: Unit/1.8.0 > < > * Connection #0 to host localhost left intact > ?????? > >> >> If you need, I'll make a short example. >> >> -- >> >> Alex >> >> _______________________________________________ >> unit mailing list >> unit at nginx.org >> https://mailman.nginx.org/mailman/listinfo/unit > > > _______________________________________________ > unit mailing list > unit at nginx.org > https://mailman.nginx.org/mailman/listinfo/unit -------------- next part -------------- An HTML attachment was scrubbed... URL: From zelenkov at nginx.com Mon Mar 4 19:02:07 2019 From: zelenkov at nginx.com (Andrey Zelenkov) Date: Mon, 4 Mar 2019 22:02:07 +0300 Subject: Two more problems with Mojolicious In-Reply-To: References: <96d3a915-6066-479e-fd3e-87bf86391907@over.ru> <1E2F0364-6545-43EC-87B1-4FC49D62F8CD@nginx.com> Message-ID: <0F575C84-4961-4ADD-ABDE-C22316875127@nginx.com> > On 4 Mar 2019, at 19:06, ????????? ?????????? wrote: > > My program outputs JSON. decode_json works fine with HTTP, to_json is required for PSGI. [..] Hi Alex, I?ve tried to use encode_json and to_json and they both work fine. For encode_json: === use Mojolicious::Lite; use Mojo::JSON qw(decode_json encode_json to_json); get '/' => sub { my $c = shift; $c->write(encode_json({test => '?????? I ? Mojolicious!'})); }; app->start; === I've got response: === HTTP/1.1 200 OK Date: Mon, 04 Mar 2019 18:53:21 GMT Server: Unit/1.8.0 Connection: close Transfer-Encoding: chunked 2a {"test":"?????? I ? Mojolicious!"} 0 === and for to_json: === use Mojolicious::Lite; use Mojo::JSON qw(decode_json encode_json to_json); get '/' => sub { my $c = shift; $c->write(to_json({test => '?????? I ? Mojolicious!'})); }; app->start; === I've got response: === HTTP/1.1 200 OK Date: Mon, 04 Mar 2019 18:54:24 GMT Server: Unit/1.8.0 Connection: close Transfer-Encoding: chunked 2a {"test":"?????? I ? Mojolicious!"} 0 === Could you please provide more information about how you try to use to_json? -- Andrey Zelenkov From tarkhil at over.ru Mon Mar 4 19:18:59 2019 From: tarkhil at over.ru (=?UTF-8?B?0JDQu9C10LrRgdCw0L3QtNGAINCf0L7QstC+0LvQvtGG0LrQuNC5?=) Date: Mon, 4 Mar 2019 22:18:59 +0300 Subject: Two more problems with Mojolicious In-Reply-To: <0F575C84-4961-4ADD-ABDE-C22316875127@nginx.com> References: <96d3a915-6066-479e-fd3e-87bf86391907@over.ru> <1E2F0364-6545-43EC-87B1-4FC49D62F8CD@nginx.com> <0F575C84-4961-4ADD-ABDE-C22316875127@nginx.com> Message-ID: Ok, got the issue. It was only valid with chunk_write. I'll replace in with more common write and see On 04.03.2019 22:02, Andrey Zelenkov wrote: >> On 4 Mar 2019, at 19:06, ????????? ?????????? wrote: >> >> My program outputs JSON. decode_json works fine with HTTP, to_json is required for PSGI. > [..] > > Hi Alex, > > I?ve tried to use encode_json and to_json and they both work fine. > > For encode_json: > > === > use Mojolicious::Lite; > use Mojo::JSON qw(decode_json encode_json to_json); > > get '/' => sub { > my $c = shift; > $c->write(encode_json({test => '?????? I ? Mojolicious!'})); > }; > > app->start; > === > > I've got response: > > === > HTTP/1.1 200 OK > Date: Mon, 04 Mar 2019 18:53:21 GMT > Server: Unit/1.8.0 > Connection: close > Transfer-Encoding: chunked > > 2a > {"test":"?????? I ? Mojolicious!"} > 0 > === > > and for to_json: > > === > use Mojolicious::Lite; > use Mojo::JSON qw(decode_json encode_json to_json); > > get '/' => sub { > my $c = shift; > $c->write(to_json({test => '?????? I ? Mojolicious!'})); > }; > > app->start; > === > > I've got response: > > === > HTTP/1.1 200 OK > Date: Mon, 04 Mar 2019 18:54:24 GMT > Server: Unit/1.8.0 > Connection: close > Transfer-Encoding: chunked > > 2a > {"test":"?????? I ? Mojolicious!"} > 0 > === > > > Could you please provide more information about > how you try to use to_json? > > -- > Andrey Zelenkov > > > > > > > _______________________________________________ > unit mailing list > unit at nginx.org > https://mailman.nginx.org/mailman/listinfo/unit From tarkhil at over.ru Mon Mar 4 19:24:33 2019 From: tarkhil at over.ru (=?UTF-8?B?0JDQu9C10LrRgdCw0L3QtNGAINCf0L7QstC+0LvQvtGG0LrQuNC5?=) Date: Mon, 4 Mar 2019 22:24:33 +0300 Subject: Two more problems with Mojolicious In-Reply-To: References: <96d3a915-6066-479e-fd3e-87bf86391907@over.ru> <1E2F0364-6545-43EC-87B1-4FC49D62F8CD@nginx.com> <0F575C84-4961-4ADD-ABDE-C22316875127@nginx.com> Message-ID: <6104236b-b4d1-77f0-a9e2-8e746fabb764@over.ru> Nope. It did not help in some cases. I'll have to get the bare minimum of code to reproduce it, that's not too clear. Most likely, some issue between me, Mojo and postgresql... On 04.03.2019 22:18, ????????? ?????????? wrote: > Ok, got the issue. It was only valid with chunk_write. I'll replace in > with more common write and see > > On 04.03.2019 22:02, Andrey Zelenkov wrote: >>> On 4 Mar 2019, at 19:06, ????????? ?????????? wrote: >>> >>> My program outputs JSON. decode_json works fine with HTTP, to_json >>> is required for PSGI. >> [..] >> >> Hi Alex, >> >> I?ve tried to use encode_json and to_json and they both work fine. >> >> For encode_json: >> >> === >> use Mojolicious::Lite; >> use Mojo::JSON qw(decode_json encode_json to_json); >> >> get '/' => sub { >> ?? my $c = shift; >> ?? $c->write(encode_json({test => '?????? I ? Mojolicious!'})); >> }; >> >> app->start; >> === >> >> I've got response: >> >> === >> HTTP/1.1 200 OK >> Date: Mon, 04 Mar 2019 18:53:21 GMT >> Server: Unit/1.8.0 >> Connection: close >> Transfer-Encoding: chunked >> >> 2a >> {"test":"?????? I ? Mojolicious!"} >> 0 >> === >> >> and for to_json: >> >> === >> use Mojolicious::Lite; >> use Mojo::JSON qw(decode_json encode_json to_json); >> >> get '/' => sub { >> ?? my $c = shift; >> ?? $c->write(to_json({test => '?????? I ? Mojolicious!'})); >> }; >> >> app->start; >> === >> >> I've got response: >> >> === >> HTTP/1.1 200 OK >> Date: Mon, 04 Mar 2019 18:54:24 GMT >> Server: Unit/1.8.0 >> Connection: close >> Transfer-Encoding: chunked >> >> 2a >> {"test":"?????? I ? Mojolicious!"} >> 0 >> === >> >> >> Could you please provide more information about >> how you try to use to_json? >> >> -- >> Andrey Zelenkov >> >> >> >> >> >> >> _______________________________________________ >> unit mailing list >> unit at nginx.org >> https://mailman.nginx.org/mailman/listinfo/unit > _______________________________________________ > unit mailing list > unit at nginx.org > https://mailman.nginx.org/mailman/listinfo/unit From ve at stack.net Fri Mar 22 12:20:15 2019 From: ve at stack.net (Vladimir Ershov) Date: Fri, 22 Mar 2019 15:20:15 +0300 Subject: Get Status of each application priocess Message-ID: <8b51f891-1321-e714-4fa1-5380149f0749@stack.net> Hello Is there any way to get the information about the state of each process of each application? What is the process state (idle, working etc). What it handles (URI). Some thing like Apache mod_status (https://httpd.apache.org/docs/2.4/mod/mod_status.html). May me it's achievable by means of some other Nginx products? Thanks, Vladimir Ershov From igor at sysoev.ru Fri Mar 22 13:21:23 2019 From: igor at sysoev.ru (Igor Sysoev) Date: Fri, 22 Mar 2019 16:21:23 +0300 Subject: Get Status of each application priocess In-Reply-To: <8b51f891-1321-e714-4fa1-5380149f0749@stack.net> References: <8b51f891-1321-e714-4fa1-5380149f0749@stack.net> Message-ID: > On 22 Mar 2019, at 15:20, Vladimir Ershov wrote: > > Hello > > Is there any way to get the information about the state of each process of each application? > What is the process state (idle, working etc). What it handles (URI). > Some thing like Apache mod_status (https://httpd.apache.org/docs/2.4/mod/mod_status.html). > > May me it's achievable by means of some other Nginx products? Hi Vova! We plan to add this functionality as a separate status process. -- Igor Sysoev http://nginx.com From spencersr at gmail.com Tue Mar 26 00:53:12 2019 From: spencersr at gmail.com (Shane Spencer) Date: Mon, 25 Mar 2019 16:53:12 -0800 Subject: Looking for a smidge more info on external type applications Message-ID: Hi all. I'm trying to get a generic external application working using python (rather than WSGI). I can see the NXT_USER_INIT environment variable and the PIDs involved and what could possibly be fileno's for potential socket work. I'm going to be giving that a test. It sounds like the file descriptor may be use for retrieving extra control information (like listen port) however. Any extra info on external type commands would be awesome. I don't see anything on public github that is parsing the environment variable NXT_USER_INIT to utilize that info. Just trying to determine the next step once a command inits. Shane Spencer about.me/ShaneSpencer -------------- next part -------------- An HTML attachment was scrubbed... URL: From max.romanov at nginx.com Tue Mar 26 10:46:54 2019 From: max.romanov at nginx.com (Max Romanov) Date: Tue, 26 Mar 2019 13:46:54 +0300 Subject: Looking for a smidge more info on external type applications In-Reply-To: References: Message-ID: <3E9565AA-38F8-4B65-ACFE-9EDBE40ECBBD@nginx.com> Hello, There is a library (libunit) which may help you to write such external app. Unfortunately, it is not documented and can be changed in next releases, but all language modules written using this library API and you may use it too. First, have a look at test external application in C: https://github.com/nginx/unit/blob/master/src/test/nxt_unit_app_test.c . In spite of the fact the app is useless, it will give you some clue how to start. Next thing is reading comments in main header file of this library (https://github.com/nginx/unit/blob/master/src/nxt_unit.h ). And, of course, you may ask here, if something is still unclear or does not work as expected. Best regards, Max > On 26 Mar 2019, at 03:53 , Shane Spencer wrote: > > Hi all. I'm trying to get a generic external application working using python (rather than WSGI). I can see the NXT_USER_INIT environment variable and the PIDs involved and what could possibly be fileno's for potential socket work. I'm going to be giving that a test. > > It sounds like the file descriptor may be use for retrieving extra control information (like listen port) however. > > Any extra info on external type commands would be awesome. I don't see anything on public github that is parsing the environment variable NXT_USER_INIT to utilize that info. Just trying to determine the next step once a command inits. > > > Shane Spencer > about.me/ShaneSpencer _______________________________________________ > unit mailing list > unit at nginx.org > https://mailman.nginx.org/mailman/listinfo/unit -------------- next part -------------- An HTML attachment was scrubbed... URL: From sergio at outerface.net Sat Mar 30 09:48:38 2019 From: sergio at outerface.net (sergio) Date: Sat, 30 Mar 2019 12:48:38 +0300 Subject: debian packages Message-ID: <4010ff79-8bfc-bec2-6885-aee262f166f3@outerface.net> Two questions about debian packages: 1. When debs for buster will be available? 2. What about inclusion into the main debian repository? -- sergio.