Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

arafat_uu's avatar

Is it possible to host Lumen API and a Laravel project in same domain?

I create two project. One is Lumen that is responsible for api. And another is Laravel project that is dependent on lumen project. If I host two different domain and linked then it is all right! But is it possible to place them as same domain as subfolder?

Ex: domain.com/ is for laravel & domain.com/lumen for api

0 likes
1 reply
jorqensen's avatar
Level 10

It's possible, you just need to configure your webserver to handle it the way you'd expect.

I'd however personally recommend that you set it up on a sub-domain instead of a sub-directory, since it can cause confusion that a route is actually an entirely different application.

Consider placing your API on api.domain.com and the actual app on domain.com.

Have a look at the Deployment section of the Laravel docs for an example NGINX configuration, you would essentially just swap the domain with api.domain.com and point the root accordingly.

1 like

Please or to participate in this conversation.