Live data from Hacker News

Nginx Unit – Universal web app server

github.com

41–50 of 201 posts

Re: Nginx Unit – Universal web app server

#41

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.

Don't know about ASP.NET, but one of the supported languages is assembly, so I'd presume C++ and Rust can easily add a wrapper around that.

> Binary-compiled languages in general: using the embedded libunit library.

From https://unit.nginx.org/keyfeatures/#supported-app-languages

Re: Nginx Unit – Universal web app server

#42

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.

Sounds like a blog post in the making

Re: Nginx Unit – Universal web app server

#43
post #31
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.

Heh. My pet peeve are useless success fields. A 200 response tells you it was successful already. We can talk about a „message“ field or something if you intend to display it to a user, but even that should be implicit by being a response to a specific request. If I send a POST /configuration, is there really something new to be gained from that message that the client cannot figure out on its own? Wouldn’t, perhaps,…

Eric S. Raymond, in his guide "The Art of Unix Programming", mentions this principle as Rule of Silence: "When a program has nothing surprising to say, it should say nothing."

His statement probably related to command line applications, but it makes sense for a lot of cases.

Re: Nginx Unit – Universal web app server

#45
post #23

So much JSON... is that the real thing, as in comments are the gateway to hell, or is it actually some practical JSON superset like JSON5? I almost see myself jury-rigging some bespoke filesystem on-ramp to that REST configuration interface. Likely with at least half a dozen scary security compromises. Then on the other hand I guess they've never been afraid of getting called opinionated and that's certainly much bet…

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.

Re: Nginx Unit – Universal web app server

#48
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.

Regarding use case. We have a bunch of frontend apps that are integrations to one of our external platforms - they get hosted in an iframe on there.

To simplify the builds we have a expressjs app that is a simple static server and proxy for API requests.

I can see something like this easily replace that - all we need is static files and a /API* endpoint to proxy - avoiding cors issues.

Re: Nginx Unit – Universal web app server

#49
I built something like this, but with much simpler syntax and automatic https simply bc I'm not smart enough to reliably set up server blocks and letsencrypt every time I route a new app.

AppServe takes care of all that, and even if I did know the syntax by heart to do it in nginx, this is still faster.

https://github.com/donuts-are-good/appserve

Re: Nginx Unit – Universal web app server

#50

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?
Post reply on HN