Live data from Hacker News

Nginx Unit – Universal web app server

github.com

71–80 of 201 posts

Re: Nginx Unit – Universal web app server

#71
post #11

Well I commend the Nginx team for trying something new and launching this, even though I'm not sure what I would use it for personally. Slightly tangental, but it always irks me when I see these kinds of responses in JSON: { "success": "Reconfiguration done." } Really this should be something like "result": "success". Using "success" as a key name tells me nothing about the data it's representing.

In this particular example, it’s actually a whole lot worse than that, by spec at least. Excerpt from their OpenAPI schema https://github.com/nginx/unit/blob/7dd5ad93a4c147b086a8d82ec... >: jsonSuccessMessage: type: object description: "JSON message on success." additionalProperties: type: string jsonErrorMessage: type: object description: "JSON message on error." additionalProperties: type: string Yes, this is as ba…

Looks like the openAPI is a little rough around the redundant status fillers? Wouldn't be the first one I guess.

Putting the redundancy with 200 or not 200 aside, I sense a certain aesthetic quality in the {"success":string}|{"error":string} approach. Namely in how it adheres to keeping the schematic stuff on left side of the colon.

Re: Nginx Unit – Universal web app server

#72
This is an interesting idea, but I feel like it is a big oversight not to have build in support for automatically getting certificates.

Instead the docs have you do something manual with certbot (a complete nono if you believe in automatic SSL and are using docker images that don't persist data, as Docker is meant to be used).

The only reason I have SSL on my domain in the first place is that my host offers a simple setup that runs automatically.

Re: Nginx Unit – Universal web app server

#73
post #56

This seems a lot more like how IIS works, unless I'm missing something? As an aside: it's always curious to see how the programming world has splintered into cliques that no longer hang out together. NGINX Unit is a "Universal" web server without support for C++, Rust, or ASP.NET! But PERL is supported, like the 1990s Linux cgi-bin world never went away.

In Linux where this is primarily expected to be used ASP.NET is extremely rare, as is C++ for web stuff, and Rust has a vanishingly small web presence still. Lots of people use Perl still though, if not for anything else, for legacy stuff. So might as well ask why it doesn't support Delphi.

And PSGI is actually really rather good (for sync stuff, I dislike the way it handles async/websockets and would tend to use Mojolicious for that) and generally used to deploy OO MVC style apps.

The Perl ecosystem has come a long way from CGI scripts just like everybody else has.

Re: Nginx Unit – Universal web app server

#74
post #11

Well I commend the Nginx team for trying something new and launching this, even though I'm not sure what I would use it for personally. Slightly tangental, but it always irks me when I see these kinds of responses in JSON: { "success": "Reconfiguration done." } Really this should be something like "result": "success". Using "success" as a key name tells me nothing about the data it's representing.

That's like when I see APIs that give you responses with a 200 code, but then in the message there's a backend error.

Re: Nginx Unit – Universal web app server

#75
post #72

This is an interesting idea, but I feel like it is a big oversight not to have build in support for automatically getting certificates. Instead the docs have you do something manual with certbot (a complete nono if you believe in automatic SSL and are using docker images that don't persist data, as Docker is meant to be used). The only reason I have SSL on my domain in the first place is that my host offers a simple…

> using docker images that don't persist data, as Docker is meant to be used

docker volumes entered the chat

Re: Nginx Unit – Universal web app server

#76

This seems a lot more like how IIS works, unless I'm missing something? As an aside: it's always curious to see how the programming world has splintered into cliques that no longer hang out together. NGINX Unit is a "Universal" web server without support for C++, Rust, or ASP.NET! But PERL is supported, like the 1990s Linux cgi-bin world never went away.

And Go apps require recompiling them to use their version of the http. ListenAndServe function. I’m not sure if this counts either…

https://unit.nginx.org/configuration/#updating-go-apps

Re: Nginx Unit – Universal web app server

#77
post #58
post #45

Earlier quoted context omitted.

JSON without comments is hell, forcing one to 1) convert JSON configuration to YAML. 2) add comments to YAML and admire it. 3) convert YAML to JSON for sending to the server.

YAML is an order of magnitude more hell...

But TOML is worse, right ? I can't write nor read TOML to save my life... :(

Re: Nginx Unit – Universal web app server

#78

This is really great! What I'm really look forward to trying is the server side WebAssembly: https://unit.nginx.org/configuration/#configuration-wasm . Huge potential!

What’s the advantage of server side WebAssembly over just running a Rust/whatever application?

My limited understanding from various blog posts is that you can still get the benefits of a container, but much faster startup/runtimes. As in WASM provides performance very close to native.

Re: Nginx Unit – Universal web app server

#79

Earlier quoted context omitted.

In this particular example, it’s actually a whole lot worse than that, by spec at least. Excerpt from their OpenAPI schema https://github.com/nginx/unit/blob/7dd5ad93a4c147b086a8d82ec... >: jsonSuccessMessage: type: object description: "JSON message on success." additionalProperties: type: string jsonErrorMessage: type: object description: "JSON message on error." additionalProperties: type: string Yes, this is as ba…

By Serde's classification, `success: {}` is a textbook externally tagged representation.

I wasn't familiar with Serde's description of this so that was a good read, thanks.

Although I still think this is a bad example of an externally tagged representation. In the Serde example they have the key as "Request" then what follows is the request object. In this example, the "success" key is followed by an arbitrary string message, which isn't obvious at all.

Re: Nginx Unit – Universal web app server

#80

Tested this with a moderately complex PHP Laravel app and got a 40% speed improvement. Very useful to be able to run multiple apps each using different lang runtimes/versions without needing separate docker containers.

How does this speed improvement compare to Laravel octane with swoole? Curious if I can switch!
Post reply on HN