Heroku Local:"http"指令是重复的

Syl*_*ain 4 nginx heroku

我在运行时遇到以下问题heroku local:

[emerg] 595#0: "http" directive is duplicate in /usr/local/etc/nginx/nginx.conf:17

我已经进入heroku/heroku-buildpack-php": "*"了我的composer.json,并且全新安装了nginx(使用brew install nginx)

有人可以向我解释可能会发生什么吗?

Syl*_*ain 9

所以似乎问题与heroku.conf生成的问题有关$root/vendor/heroku/heroku-buildpack-php/conf/nginx/heroku.conf.php

Heroku local 运行nginx nginx: master process nginx -g daemon off; include $root/vendor/heroku/heroku-buildpack-php/conf/nginx/heroku.conf;

因此,无论/usr/local/etc/nginx/nginx.confheroku.conf被加载,因此重复的指令.

我修改/usr/local/etc/nginx/nginx.conf为只包括

worker_processes  1;
events {
  worker_connections  1024;
}
Run Code Online (Sandbox Code Playgroud)

因为没有事件部分,nginx将无法启动,剩下的就剩下了heroku.conf.