0

I have no idea if it is possible but I heard that the best practice is to create a frontend project and a backend project as two independence projects. To do that, I should use Nginx, right? But how exactly do that and how exactly is it works?

I just create an angular2 project with node.js and start the server to listen to for example 80 port.

Then I create a java project with jetty and start the server to listen to for example 90 port.

Then, should I in some way create Nginx project to merge frontend and backend? I need help cause I'm afraid I can't understant how to do that.

2
  • nginx would host your project. Node.js is essentially "Backend" for an HTML/JS frontend - although obviously you can mix and match various languages for front and back end stuff. You don't even need nginx if you want to just host using node.js, but I'd still recommend it. Commented Jun 12, 2016 at 20:06
  • Node.js is a backend... What's Jetty for? The only purpose of Nginx is a "reverse proxy"/load balancer/static resource server Commented Jun 12, 2016 at 20:07

1 Answer 1

1

It looks like you're mixing up a few things here:

In general it would make sense that your project is either written in JavaScript, and is running in Node.js, or written in Java (or a JVM language) as a Servlet, in which case it will run inside a Servlet Container like Jetty or Tomcat.

A web server like nginx or Apache httpd can be placed in front of the backend service in order to handle static content, provide caching, security, load balancing etc.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.