【问题标题】:configuring swoole http-server without nginx in front配置 swoole http-server 前面不带 nginx
【发布时间】:2022-02-07 16:08:09
【问题描述】:

如何在没有 nginx 的情况下配置 swoole http-server? 我的问题是域路由。我在哪里可以为 laravel 辛烷中的 swoole http-server 配置特定域? 我在我的服务器上配置了一个指向我的子域(api.domain.com、portal.domain.com)的 nginx。 api 和 portal 都使用 octane 来处理请求。 我想知道如何去掉 nginx 直接使用 swoole http-server?

在此先感谢并为我的英语感到抱歉

【问题讨论】:

    标签: laravel swoole laravel-octane


    【解决方案1】:

    使用 NGINX 作为网络服务器、负载均衡器或反向代理(您的用例)并不是一个坏主意。 让您的应用程序处理您的业务,而不是 Web 服务器。

    但是如果你想在你的 Laravel 应用程序中处理域或子域,你可以使用 Laravel 路由器。

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

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

    【讨论】:

      猜你喜欢
      • 2018-12-16
      • 2020-09-05
      • 1970-01-01
      • 1970-01-01
      • 2014-05-29
      • 2021-12-18
      • 1970-01-01
      • 2014-01-30
      • 1970-01-01
      相关资源
      最近更新 更多