502 Bad Gateway for Laravel Herd in MacOs

1.5k views Asked by At

I am using Laravel Herd. Nginx version 1.25.2, php version 8.2.11. I installed it yesterday and created a sample project in Laravel. When I wrote sample.test to my browser it worked for me but today somehow it stopped working. I looked at Herd and saw these errors. I checked the port and I am sure it is empty. I both checked from terminal and Activity Monitor. How can I solve it?

1

There are 1 answers

0
IgorR On

Something is already using port 80 on your machine. It could be the same process leftover from yesterday or something completely different.

You can see which processes are occupying the port on OS X by using lsof:

lsof -i :80

This will give you a process that is currently using that port. Here is my example:

COMMAND     PID         USER   FD   TYPE             DEVICE SIZE/OFF NODE NAME
com.docke 66453 igorrinkovec  196u  IPv6 0x1d4db43651273127      0t0  TCP *:ddi-tcp-1 (LISTEN)

This will help you figure out what app you need to disable, or allow you to use the kill command to kill the process using the PID in the table.