R
Railway9mo ago
wdytgn

Getting 413 Request Entity Too Largenginx/1.24.0

Hey guys so i have deployed my applications via github, which is laravel app, when i upload images which is only 1.1MB, it said that the request entity too large. How can i solve this? please send me any help since i'm new on deploying and stuff
Solution:
place these two files into the root of your project
Jump to solution
44 Replies
MantisInABox
MantisInABox9mo ago
This is an issue with the default nginx configuration. Your file exceeds the default client_max_body_size which can be configured through nginx. I am not 100% sure on how to adjust it within Railway, but adjusting this value would help significantly. Let me see if I can figure it out for you. This could also be an issue with the php configuration in the container... the php.ini you can change upload_max_filesize and post_max_size
wdytgn
wdytgn9mo ago
thanks for replying btw, how to configure the php.ini? i dont have any file named php.ini, should i create it instead? and pull it to my main branch?
Brody
Brody9mo ago
vin is working on a drop in solution, stay tuned
MantisInABox
MantisInABox9mo ago
Then let me know if your upload works for you
wdytgn
wdytgn9mo ago
hey i just lost the solution that u sent me before, could u please resend it?
MantisInABox
MantisInABox9mo ago
Brody deleted the message by accident, but could you place a file in the root of your project called nixpacks.toml then paste the following in EXACTLY as you see it. Then redeploy and try your upload
[phases.setup]
cmds = ['echo "upload_max_filesize=100M;" >> /nix/store/rzcijhxwxbld02mpvx288nf6bzv7ybhz-php-with-extensions-8.2.10/lib/php.ini', 'echo "post_max_size=100M;" >> /nix/store/rzcijhxwxbld02mpvx288nf6bzv7ybhz-php-with-extensions-8.2.10/lib/php.ini']
[phases.setup]
cmds = ['echo "upload_max_filesize=100M;" >> /nix/store/rzcijhxwxbld02mpvx288nf6bzv7ybhz-php-with-extensions-8.2.10/lib/php.ini', 'echo "post_max_size=100M;" >> /nix/store/rzcijhxwxbld02mpvx288nf6bzv7ybhz-php-with-extensions-8.2.10/lib/php.ini']
wdytgn
wdytgn9mo ago
okay lemme try it
Brody
Brody9mo ago
it wasn’t by accident 🤣
wdytgn
wdytgn9mo ago
you mean here right and then i got this
Dockerfile:25

-------------------

23 | # build phase

24 | COPY . /app/.

25 | >>> RUN composer install && php artisan optimize && php artisan storage:link && php artisan migrate --force --seed

26 |

27 |

-------------------

ERROR: failed to solve: process "/bin/bash -ol pipefail -c composer install && php artisan optimize && php artisan storage:link && php artisan migrate --force --seed" did not complete successfully: exit code: 1



Error: Docker build failed
Dockerfile:25

-------------------

23 | # build phase

24 | COPY . /app/.

25 | >>> RUN composer install && php artisan optimize && php artisan storage:link && php artisan migrate --force --seed

26 |

27 |

-------------------

ERROR: failed to solve: process "/bin/bash -ol pipefail -c composer install && php artisan optimize && php artisan storage:link && php artisan migrate --force --seed" did not complete successfully: exit code: 1



Error: Docker build failed
No description
MantisInABox
MantisInABox9mo ago
Okay, you can remove it. Back to the drawing board for me
wdytgn
wdytgn9mo ago
No description
wdytgn
wdytgn9mo ago
okayy
MantisInABox
MantisInABox9mo ago
Wait no. You didn't commit the file properly You need to copy everything I sent, exactly how I sent it including the [phases.setup]
wdytgn
wdytgn9mo ago
ah okayy wait sorry my bad bro
wdytgn
wdytgn9mo ago
still failed vin \
No description
No description
Want results from more Discord servers?
Add your server