0

I have a web-application using nginx as a reverse-proxy and using the express framework as my backend in node.js. I am confused which is the web server, maybe both or maybe it's a grey-zone in my case. I use react, so the application features client side rendering, and nginx holds these files should it make a difference.

according to developer.mozilla.org

On the software side, a web server includes several parts that control how web users access hosted files, at minimum an HTTP server. An HTTP server is a piece of software that understands URLs (web addresses) and HTTP (the protocol your browser uses to view webpages). It can be accessed through the domain names (like mozilla.org) of websites it stores, and delivers their content to the end-user's device.

&

A web server first has to store the website's files, namely all HTML documents and their related assets, including images, CSS stylesheets, JavaScript files, fonts, and videos.

Taking this into consideration, I would say that Nginx is the web-server since it holds the html file. However, I really am not sure. Is it one of the two, both or is it a grey-zone?

  • Quoting @JörgWMittag Your question is unclear. Can you explain what the concrete Software Engineering problem is that you are facing? I.e. in what way does not knowing the answer to this question stop you from engineering your application / system? The way the question is phrased now, it almost sounds like it is not about Software Engineering as defined in the help center at all, it sounds more like a naming question. – Laiv Mar 25 at 9:52
0

Technically the Node.js application is the web-server because it does the job of actually servicing your requests.

Nginx is simply a proxy that forwards requests to your Node.js application.

Note that it could be that your express app only provides the API and nginx serves static content. In this case your web server would be Nginx. Note that it is usually simpler to have Node.js do everything.

  • So, according to your reasoning, if choosing an irrelevant name for a relevant component of the architecture is too hard, just drop that element from the architecture. Interesting. – Laiv Mar 25 at 15:20
  • @Laiv - I'm not sure why you reached this conclusion from my answer. Maybe I can clarify: I'm not recommending any particular approach. I just mentioned what I have noticed most setups look like from my experience. If I had to make a recommendation, I would most certainly go with nginx as a proxy in front of my Node.js application :) – Victor Parmar Mar 26 at 12:45

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.