【发布时间】:2020-05-29 04:41:15
【问题描述】:
现在已经3天了,我仍然无法解决这个问题。我刚刚在我的 Yosemite 上安装了 vagrant box。我正在学习使用 vm。按照Laravel Homestead 的步骤,我安装了流浪汉宅基地。但它给了我 502 Bad gateway。我也在主机文件中设置了 laravel.local。
我尝试了 ngnix (1.8.0) 的其他链接,但是我无法在 homestead vm 上运行 laravel !!?
这是 /var/log/nginx/laravel.local-error.log 的输出
2015/07/12 18:54:31 [error] 957#0: *20 connect() failed (111: Connection refused) while connecting to upstream, client: 192.168.10.1, server: la5.dev, request: "GET / HTTP/1.1", upstream: "fastcgi://127.0.0.1:9000", host: "la5.dev"
2015/07/12 19:03:07 [error] 1957#0: *1 connect() failed (111: Connection refused) while connecting to upstream, client: 192.168.10.1, server: la5.dev, request: "GET / HTTP/1.1", upstream: "fastcgi://127.0.0.1:9000", host: "la5.dev"
2015/07/12 19:04:33 [error] 2006#0: *1 connect() failed (111: Connection refused) while connecting to upstream, client: 192.168.10.1, server: la5.dev, request: "GET / HTTP/1.1", upstream: "fastcgi://127.0.0.1:9000", host: "la5.dev"
vagrant@homestead:/var/log/nginx$
这是我的 Homestead.yaml
ip: "192.168.10.10"
memory: 2048
cpus: 1
provider: virtualbox
authorize: ~/.ssh/id_rsa.pub
keys:
- ~/.ssh/id_rsa
folders:
- map: /Users/maahedev/code/la5
to: /home/vagrant/la5
sites:
- map: la5.dev
to: /home/vagrant/la5/public
databases:
- homestead
variables:
- key: APP_ENV
value: local
# blackfire:
# - id: foo
# token: bar
# client-id: foo
# client-token: bar
# ports:
# - send: 93000
# to: 9300
# - send: 7777
# to: 777
# protocol: udp
非常感谢任何帮助/建议。
编辑:netstat -antp 的输出
(Not all processes could be identified, non-owned process info
will not be shown, you would have to be root to see it all.)
Active Internet connections (servers and established)
Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN -
tcp 0 0 0.0.0.0:5432 0.0.0.0:* LISTEN -
tcp 0 0 0.0.0.0:443 0.0.0.0:* LISTEN 2477/nginx: worker
tcp 0 0 0.0.0.0:57219 0.0.0.0:* LISTEN -
tcp 0 0 127.0.0.1:11300 0.0.0.0:* LISTEN -
tcp 0 0 0.0.0.0:3306 0.0.0.0:* LISTEN -
tcp 0 0 127.0.0.1:11211 0.0.0.0:* LISTEN -
tcp 0 0 0.0.0.0:6379 0.0.0.0:* LISTEN -
tcp 0 0 0.0.0.0:111 0.0.0.0:* LISTEN -
tcp 0 0 0.0.0.0:80 0.0.0.0:* LISTEN 2477/nginx: worker
tcp 0 0 10.0.2.15:22 10.0.2.2:50267 ESTABLISHED -
tcp6 0 0 :::22 :::* LISTEN -
tcp6 0 0 :::5432 :::* LISTEN -
tcp6 0 0 :::47876 :::* LISTEN -
tcp6 0 0 :::6379 :::* LISTEN -
tcp6 0 0 :::111 :::* LISTEN -
【问题讨论】:
-
你有端口从访客转发到主机吗?
-
你能详细解释一下在哪里做端口转发吗?
-
我正在使用虚拟盒子和流浪者。我遵循了 laravel 和 vagrant site 的步骤。但是,它仍然无法正常工作。
-
你能通过 8000 端口从客户机访问 HHVM 吗?在您的情况下,Nginx 会尝试访问端口 9000。官方文档说每个站点都可以通过 HTTP 端口 8000 访问
-
如果您能帮助我运行一些 cmets,我将不胜感激。我检查了 nginx.conf,有 listen 80 可用。
标签: php nginx laravel-5 vagrant homestead