新版使用unix sock来使用的话,需要怎么配置,
config/process.php 里listen使用 unix:///tmp/bro.scok
<?php
return [
'webman' => [
'handler' => Http::class,
# 'listen' => 'unix:///tmp/bro.sock',
'listen' => env('listen', 'http://127.0.0.1:8787'),
'transport' => \Workerman\Protocols\Http::class,
'count' => cpu_count() * 4,
'user' => '',
'group' => '',
'reusePort' => false,
'eventLoop' => '',
'context' => [],
'constructor' => [
'requestClass' => Request::class,
'logger' => Log::channel('default'),
'appPath' => app_path(),
'publicPath' => public_path()
]
],
];
需要添加transport这个选项么?然后我使用代理之后一直是502,之前的版本是可以的
老版添加transport之后可以使用,新版的没有ngnix配置,却无法使用,
老版本的配置发下
$ser_options = [
'listen' => env('server.socket'),
'transport' => 'tcp',
'context' => [],
'name' => 'webman',
'count' => intval(env("server.workers", 4)),
'user' => '',
'group' => '',
'reusePort' => false,
'event_loop' => '',
'stop_timeout' => 2,
'pid_file' => runtime_path() . '/webman.pid',
'status_file' => runtime_path() . '/webman.status',
'stdout_file' => runtime_path() . '/logs/stdout.log',
'log_file' => runtime_path() . '/logs/workerman.log',
'max_package_size' => 10 1024 1024
];
if (strpos($ser_options['listen'], 'unix') !== false) {
$ser_options['protocol'] = \Workerman\Protocols\Http::class;
}
return $ser_options;
找到原因了,加protocol,可以了
谢谢,
不客气