I have tried to deploy the Laravel application using Nginx web server. However, I get the 502 Bad Gateway error. What could be the reason? Is it permission issue or something else.
Following code snippet shows the default site configuration file.
#user nobody;
worker_processes 1;
#error_log logs/error.log;
#error_log logs/error.log notice;
#error_log logs/error.log info;
#pid logs/nginx.pid;
events {
worker_connections 1024;
}
http {
include mime.types;
default_type application/octet-stream;
error_log /opt/homebrew/var/log/nginx/error.log;
access_log /opt/homebrew/var/log/nginx/access.log;
sendfile on;
#tcp_nopush on;
keepalive_timeout 65;
server {
listen 8080;
server_name dev.easysell.local;
root /Users/hassanali/Development/server/laravel/projects/easysell-laravel/public;
index index.php index.html index.htm;
location / {
try_files $uri $uri/ /index.php?$query_string;
}
location ~ .php$ {
include fastcgi_params;
fastcgi_pass unix:/Users/hassanali/Library/Application Support/Herd/herd82.sock;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
}
location ~ /.ht {
deny all;
}
}
# Uncomment or modify as needed
# include servers/*;
}