D
D
Dmitriy2020-10-01 21:20:44
Apache HTTP Server
Dmitriy, 2020-10-01 21:20:44

How to host Vue.js SPA, Laravel, Apace on VPS?

There is a project consisting of two folders:

  • client: Vue.js
  • api: Laravel (as SPA API)


There is a VPS + domain.
I want to do this:
API on api.domain.com
SPA on domain.com

How is it implemented?
Googled, searched for guides, uploaded the API via VirtualHost, I don’t know how to upload Vue SPA so that it works fine with the API?
What solutions can there be?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Sergey delphinpro, 2020-10-01
@delphinpro

Recently launched a similar configuration.
We put Apache, Nodejs, Nginx on the server.
In Apache, we set up a virtual host on my-site.ru:8080
For spa, we raise the express server on my-site.ru:3000 (port numbers are conditional)
In nginx, we raise a server on the eightieth port and distribute requests.
Root ('/') - send to node server, apish ('/api') - to apache.
We start the Nodovsky express server using pm2
Actually, that's all.
I asked a question here , there are examples of configs.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question