D
D
Dill52020-12-11 11:29:37
Software Deployment
Dill5, 2020-12-11 11:29:37

How to organize laravel and next js on the same domain?

Hello! Question: in the development of a project on laravel (api), next js (client side, respectively). How to work with them separately is clear, how to work with them locally on openserver is also clear. But how to upload to hosting? So that they are located on the same domain? It turns out that you need to have 2 folders, one with the front, the other with the back (api), but it won’t work like that ... Googled this question for several days, docker is advised in one of the sources, also one developer from the UK wrote that it’s impossible hosted on the same domain.. But I think it's possible without docker. Tell me plz in which direction to dig.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
I
Ilya, 2020-12-11
@Dill5

next to the main domain, api from Lara to the subdomain.
If you absolutely need it on one domain, then you can configure it through the location of nginx like this:
domain.com - goes to next
domain.com/xapi/ - goes to Laravel

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question