Heroku Nginx HTTP 413 Object Too Big

I get 413 error while uploading 4 MB file. I have already created the .user.ini file in the public/ folder. to allow up to 10 MB files

So, I used client_max_body_size as on my nginx.conf , but I still get 413.

 location / { index index.php; try_files $uri $uri/ /index.php?$query_string; client_max_body_size 10M; } 

This configuration is due to the fact that I'm using Laravel 5 .

This is my Procfile

 web: vendor/bin/heroku-php-nginx -C nginx.conf public/ 

Did I do something wrong?

+6
source share
1 answer

Perhaps a little late, but in order to fix this, move client_max_body_size 10M; outside the section. Like this:

 client_max_body_size 10M; location / { index index.php; try_files $uri $uri/ /index.php?$query_string; } 

See https://github.com/heroku/heroku-buildpack-php/blob/beta/conf/nginx/heroku.conf.php#L35 for help on how the character includes this file.

+1
source

Source: https://habr.com/ru/post/988197/


All Articles