```
server {
listen 80;
server_name 127.0.0.3;
root D:/www/www/SSE-learn/public;
location / {
index index.php index.html index.htm;
try_files $uri $uri/ /index.php?$query_string;
}
location ~ \.php$ {
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
}
```
nginx 的配置是这样的,别的都是默认的,版本是 1.11.1
```
set_time_limit(0);
header('Content-Type: text/event-stream');
header('X-Accel-Buffering: no');
while(true) {
$sleepSecs = mt_rand(250, 500) / 1000.0;
usleep($sleepSecs * 1000000);
$bid = mt_rand(1000, 2000) / 1000.0;
$t = microtime(true);
$d = array(
'timestamp' => gmdate('Y-m-d H:i:s', $t) . sprintf('. %03d', ($t*1000)%1000),
'symbol' => 'funny',
'bid' => $bid,
);
echo 'data:' . json_encode($d) . PHP_EOL . PHP_EOL;
@
ob_flush(); @
flush();
```
PHP 代码大概是这样子的,然后想问下 windows 下运行 php-cgi ,是不是就是单进程模式运行的。