Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

Lars-Janssen's avatar

502 Bad Gateway (no laravel)

Hi,

When I visit my magento 2 project I get the following error:

502 Bad Gateway
ProtocolException('Server connection to www.magento-project.test:8081 failed: Error connecting to "www.magento-project.test": [Errno 61] Connection refused',)
I'm trying to run a magento 2 project. I use Homestead for this, my Homestead.yaml looks like this:
---
ip: "192.168.10.10"
memory: 2048
cpus: 1
provider: virtualbox

authorize: ~/.ssh/id_rsa.pub

keys:
    - ~/.ssh/id_rsa

folders:
    - map: /Users/lars/Documents/code
      to: /home/vagrant/code

sites:
    - map: magento-project.test
      to: /home/vagrant/code/magento-project
      port: 8081
      php: "7.0"
      type: "apache"

databases:
    - homestead

When I ssh into my server (vagrant ssh) I can see that homestead created my projects successful. I've added the ip address to my hosts file on my mac 192.168.10.10 magento-project.test. When I start my server and exec command flip. It starts using apache instead of nginx so that's working.

But when I go to http://www.magento-project.test:8081/ I get the 503.

I already tried vagrant reload, vagrant provision, vagrant halt but nothing works. Any ideas?

When I try this with a laravel project (nxinx) it's working.

What can I try?

0 likes
0 replies

Please or to participate in this conversation.