I am trying to upload 30MB file on my server and its not working.
When I upload 30MB file, the page loads "Page Not Found"
When I upload a 3MB file, I receive "413 Request Entity Too Large" with nginx/0.6.32
I am trying to find nginx so I can increase "client_max_body_size" but I am unable to find nginx installed on my server. I even tried running:
vi /etc/nginx/nginx.conf
or
vi /usr/local/nginx/conf/nginx.conf
to check if the config file exists, but I couldnt find it on my server.
Is there anyway to resolve this issue? Or do I have to installed nginx on my server.
EDIT:
I have made all necessary changes in my php.ini files,
post_max_size 128M
upload_max_filesize 100M
memory_limit 256M
Thanks, Raju
Please enter domain nginx file :
Add to file this code
If you get error use this command
First edit the Nginx configuration file (
nginx.conf
)Location:
sudo nano /etc/nginx/nginx.conf
Add following codes:
Then Add the following lines in PHP configuration file(
php.ini
)Location:
sudo gedit /etc/php5/fpm/php.ini
Add following codes:
I got the upload working with above changes. But when I made the changes I started getting 404 response in file upload which lead me to do further debugging and figured out its a permission issue by checking nginx error.log
Solution:
Check the current user and group ownership on /var/lib/nginx.
drwx------. 3 nginx nginx 17 Oct 5 19:31 /var/lib/nginx
This tells that a possibly non-existent user and group named nginx owns this folder. This is preventing file uploading.
In my case, the username mentioned in "/etc/nginx/nginx.conf" was
Change the folder ownership to the user defined in nginx.conf in this case vagrant.
Verify that it actually changed.
Reload nginx and php-fpm for safer sade.
The permission denied error should now go away. Check the error.log (based on nginx.conf error_log location).