No. Usually web application would be exposed through FastCGI or similar
protocol.
Insisting that either your tiny web application that can do next to nothing is
the thing that owns 80/tcp (and/or 443/tcp) or runs behind a HTTP proxy is
stupid. Proxying HTTP requests properly is harder than it sounds, which is
surprising every now and then and thus is easy to screw up (what happens to
Host: header? who is the TCP client? is it HTTP or HTTPs?), and your tiny
web application, as I've called it, is not the only thing I want to host on
the machine.
Practically every company I've worked with uses an HTTP reverse proxy. When you use something like nginx, it's really not hard at all to get right. Support for HTTP is more widespread than support for FastCGI these days, especially with more obscure tech stacks.
Edit: You can run multiple apps on separate ports, so that shouldn't be an issue.
> It's not a matter of nginx. It's a matter of what assumptions are hardcoded in the application.
You haven't actually given any good examples for what makes HTTP reverse proxying bad. Things like dealing with the Host header are two-minute fixes that you only have to deal with once, but they really shouldn't even be issues in the first place. HTTP is well supported, well understood, easy to implement, and easy to scale. On the flip side, you might waste a lot of time trying to get your tech stack working with FastCGI if there isn't already existing support, and you don't benefit from any HTTP support you already have.
> Such a deployment looks terrible at best.
Again, "looks terrible" is not a valid argument against it.
> I only met FastCGI in PHP. All NodeJS apps I saw used HTTP.
And I met FastCGI in Python, Perl, Ruby, and Erlang (though I haven't used the
last one yet). Oh, and uWSGI can expose anything it runs through FastCGI.
My personal opinion is that web crowd (most of JavaScript programmers fall in
here) just doesn't want to learn from anybody else.
> Is there any benefit of doing it that way?
Compared to running the tiny web application on 80/tcp? Sure: I can run more
than one and I don't need root privileges for the application.
Compared to running the application behind a reverse proxy? Ditto: it's
virtually impossible to get the setup wrong, so it's easier in the long run.