0

how can I configure a swoole http-server without nginx? my problem is domain routing. where can I configure a specific domain for swoole http-server in laravel octane? I have configured an nginx on my server that points to my subdomains (api.domain.com, portal.domain.com). api and portal both use octane to serve requests. I wanna know how can I drop nginx and use swoole http-server directly?

thanks in advance and sorry for my eng

1 Answers1

0

Using NGINX as the webserver, load balancer, or reverse proxy (your use case) is not a bad idea. Let your application handle your business, not web server stuff.

But if you want to handle domains or subdomains in your Laravel application, you can use the Laravel router.

Route::domain('{account}.example.com')->group(function () {
    Route::get('user/{id}', function ($account, $id) {
        //
    });
});

Laravel documentation: https://laravel.com/docs/8.x/routing#route-group-subdomain-routing

Milad Rahimi
  • 3,464
  • 3
  • 27
  • 39