monstajamss's avatar

Laravel Image Upload (504 Gateway Timeout Ubuntu, Nginx)

Before deploying my laravel project on Vultr Ubuntu Ngix i was able to upload images locally but any time i try uploading picture on my liveserver, it takes time to load and end up giving 504 Gateway Timeour nginx/1.16.1 (Ubuntu)

Even when the image size is less than 1MB

this is usually the link generated https://monstajams.net/image//tmp/phpScQbKd

What am i doing wrong?

0 likes
5 replies
siangboon's avatar

there are few value setting in php.ini you can try:

max_input_time (not max_execution_time!) upload_max_filesize post_max_size

but make sure configure it appropriately, otherwise, it may causing performance issue...

monstajamss's avatar

@siangboon what figures would be put inside or i just paste everything inside?

how do i configure it also?

monstajamss's avatar

Did this in my php.ini

memory_limit = 32M upload_max_filesize = 16M post_max_size = 16M max_execution_time = 30 max_input_time = -1

Still did not work

monstajamss's avatar

i have this nginx

fastcgi_read_timeout 600; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; fastcgi_intercept_errors off; fastcgi_buffer_size 16k; fastcgi_buffers 4 16k; fastcgi_connect_timeout 600; fastcgi_send_timeout 600;

siangboon's avatar

the figures is depend on your application need, but it's big for me... anyway, try set max_execution_time = 120 for testing purpose... if it's still fail it may be other configuration/permission issue causing the error, try to find any server logs it may help..

Please or to participate in this conversation.