Skip to content
Advertisement

Laravel 502 Bad Gateway Error

I use Laravel 5.3 with the latest Homestead Setup. When I make a POST Request to my API, I get this error according to the log file:

2016/10/29 12:44:34 [error] 776#0: *28 recv() failed (104: Connection reset by peer) while reading response header from upstream, client: 192.168.10.1, server: loc.medifaktor, request: “POST /api/v1/mfusers HTTP/1.1”, upstream: “fastcgi://unix:/var/run/php5-fpm.sock$

I use POSTMAN to make the POST Request sending it to the URL: http://loc.medifaktor/api/v1/mfusers

which is a homestead installation and runs locally on my computer.

The client address mentioned in this error is 192.168.10.1 which is actually not true, as I use 192.168.10.10. Could this be the mistake and how do I change that?

[![enter image description here][1]][1]

I am using a fresh install of Laravel and I tried other requests like GET which work fine. Just the POST Request throws this error.

The php-fpm.log shows:

JavaScript

This is the output of the nginx config:

JavaScript

Advertisement

Answer

Change your fastcgi_pass to 127.0.0.1:9000 in your website’s nginx sites_enabled conf file.

User contributions licensed under: CC BY-SA
7 People found this is helpful
Advertisement