Last active
April 8, 2020 23:47
-
-
Save cjlaborde/64c2cf18e42063d17b5f42c3acd9f7a0 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
### File Limit | |
https://www.tecmint.com/limit-file-upload-size-in-nginx/ | |
#### Set in http block which affects all server blocks (virtual hosts). | |
``` | |
http { | |
... | |
client_max_body_size 100M; | |
} | |
``` | |
#### Set in server block, which affects a particular site/app. | |
``` | |
server { | |
... | |
client_max_body_size 100M; | |
} | |
``` | |
#### Set in location block, which affects a particular directory (uploads) under a site/app. | |
``` | |
location /uploads { | |
... | |
client_max_body_size 100M; | |
} | |
``` | |
#### Save the file and restart Nginx web server to apply the recent changes using following command. | |
``` | |
# systemctl restart nginx #systemd | |
# service nginx restart #sysvinit | |
``` | |
### on PHP edit file limit | |
code . /etc/php/7.4/fpm/php.ini | |
upload_max_filesize = 20M |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment