简体   繁体   中英

Nginx usage - java jetty + angular2 node.js

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.

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM