I am facing a strange error. We moved our Laravel 8 app from apache2 to nginx under Aws ELB load balancer. Now the problem is, if my APP_ENV value is production/testing, I am not able to log in to my app it shows 504 gateway timeout but if I change my APP_ENV to local, it is working fine.
I tested this multiple times but faced the same result. Can anyone help me out with this? TIA
2
Answers
There are several ways in which you can set the timeout for php-fpm. In /etc/php5/fpm/pool.d/www.conf I added this line request_terminate_timeout = 180
location ~ .php$ {fastcgi_pass unix:/var/run/php5-fpm.sock;fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;fastcgi_read_timeout 180;include fastcgi_params;}
You need to check Aws ELB load balancer timeout setting because
php timeout setting can’t override load balancer timeout setting.