W
W
web_dev2014-12-07 02:26:48
JavaScript
web_dev, 2014-12-07 02:26:48

Some http server and tomcat integration?

Hello.
I can not understand for myself, can someone tell me?
I got the idea to experiment. But I still don't quite understand one thing.
I want to take a VPN, buy a domain name, try to install a server on it so that I can learn from real examples.
My difficulty is the following. Backend(REST) ​​- I develop in Java, respectively Maven -> war -> Tomcat.
I want to make Frontend as a separate project. Haven't decided yet either pure HTML+jQery or AngularJs - it doesn't matter.
But for Frontend I will need another server as I understand it. For example nginx or Apache HTTP.
Two servers, respectively 2 ports. And how to configure all this on 1 domain so as not to specifically specify the port?
I read about The Apache Tomcat Connector, off documentation and articles are https://www3.ntu.edu.sg/home/ehchua/programming/ho...
www.mydomen.com/index.html - the corresponding page from javaScript was opened ( Frontend) of the project. At the same time, it immediately requests the necessary information from the Backend project.
Then I need to submit a form from this page. Accordingly, POST to the Backend project that is running on Tomcat.
The essence of the question - how can I organize the correct operation of two projects on different servers and on the same domain name? Or what is the best way to organize this?
Thank you!

Answer the question

In order to leave comments, you need to log in

2 answer(s)
V
Vladimir Abramov, 2014-12-07
@kivsiak

And what's the problem then? you raise tomkat on 8001 for example. On 80 nginx. And proxy everything that comes from /api/ to the tomcat. Give the nginx statics. A standard scheme for deploying web applications with Java backing.
Google for keywords tomcat nginx reverse proxy.

W
web_dev, 2014-12-07
@web_dev

Let's say I set up this redirect and if I send the form from the frontend to the following address - (POST) www.mydomen.com/create, will nginx redirect this request to the tomcat server? For example, it will be on www.localhost:9000/, then the POST request will call www.localhost:9000/create?
I don't really understand this...
Thank you.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question