I have a web application w1 (SPA):
The webserver WS is located in a physical server X
The applicationserver AS il located in an other physical server Y.
The user call the the webserver to start w1 application (http://WS/w1)
Non the browser have the view, but not the data.
To retrieve data w1 applicatio call AS by ajax http GET calls (http://AS/car/df785er/plate for example to retrie a plate of a car)
Summing, in a MVC design, the View is retrieved from WS, the Model is retrieved from AS.
This structure is correct? Or the correct structure is have WS and AS inn the same physical machine?
The structure of your application is correct... BUT the browser by default will block, for security reasons, the ajax requests made to the model AS.
There are several possible solutions. Those I've used are:
Which solution to apply depends on security considerations, what type of requests you are making (eg. CORS only allows GET, HEAD amd POST), etc...