Skip to content

Instantly share code, notes, and snippets.

@cjlaborde
Last active April 8, 2020 23:47
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cjlaborde/64c2cf18e42063d17b5f42c3acd9f7a0 to your computer and use it in GitHub Desktop.
Save cjlaborde/64c2cf18e42063d17b5f42c3acd9f7a0 to your computer and use it in GitHub Desktop.
### 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