# File Manager Upload Size Limit
The maximum allowed file size for uploads through the File Manager is controlled by the FILE_MANAGER_UPLOAD_MAX_FILESIZE environment variable. The same value is applied to the application API, the front-end, and the nginx reverse proxies in front of the application.
Previously the File Manager enforced a hard-coded 1 GB limit in the API. Files larger than that were rejected both server-side and in the client interface, and the limit could not be changed without modifying the application code. The limit is now configurable, shared by all components, and the default remains 1 GB unless overridden.
# Changing the Upload Size Limit
- Open the environment file:
sudo nano /opt/panelalpha/app/.env - Add or update the
FILE_MANAGER_UPLOAD_MAX_FILESIZEline. Accepted formats follow standard PHP/byte-size notation and are parsed both by nginx and by the API:Other valid values includeFILE_MANAGER_UPLOAD_MAX_FILESIZE=1G1024M,2048M,3G, and512M. - Save the file and recreate the
apiandnginxcontainers so the entrypoint re-renders the nginx templates and reloads the configuration. A plaindocker compose restartis not sufficient because template substitution only happens at container start:The nginx configuration files are shipped as templates (cd /opt/panelalpha/app && docker compose up -d*.tpl), and theclient_max_body_sizedirective is rendered into the main nginx proxy and the API service nginx at container start. Recreating the containers viaup -dre-renders the templates and reloads bothapiandnginx— there is no need to edit any rendered config file by hand. - Verify the change by checking the rendered nginx configuration:The displayed value should match the one set in
cd /opt/panelalpha/app && docker compose exec nginx grep -r client_max_body_size /etc/nginx/conf.d/.env.
# Troubleshooting
# Uploads Larger Than the Configured Size Fail with HTTP 413
Problem: A file accepted by the File Manager UI is rejected during upload with 413 Request Entity Too Large.
Solution: Verify that FILE_MANAGER_UPLOAD_MAX_FILESIZE in /opt/panelalpha/app/.env is set high enough for the file you are uploading (the default is 1G, with a fallback of 1024M when unset), then recreate the api and nginx containers:
cd /opt/panelalpha/app && docker compose up -d
The upload limit is enforced by nginx via client_max_body_size; PHP itself is configured with upload_max_filesize = 0 and post_max_size = 0 (no limit), so the nginx value is the effective ceiling.
# The File Manager UI Rejects Files Smaller Than the Server Accepts
Problem: The front-end refuses a file while a direct API request for the same file would succeed.
Solution: The front-end reads the limit from the API configuration. If the API was restarted after the change but the nginx templates were not re-rendered (or vice versa), the two values may temporarily disagree. Restart the full stack listed in the previous step and reload the File Manager page in the browser to pick up the new limit.
# The Configured Value Is Not Applied After Editing .env
Problem: Changing FILE_MANAGER_UPLOAD_MAX_FILESIZE has no effect on uploads.
Solution:
- Confirm the file was saved in the expected location:
sudo cat /opt/panelalpha/app/.env | grep FILE_MANAGER_UPLOAD_MAX_FILESIZE - Confirm the application containers were recreated after the change. The substitution into nginx templates and the API only happens at container start, so use
docker compose up -d(not justrestart). - Confirm the rendered nginx configuration reflects the new value:
cd /opt/panelalpha/app && docker compose exec nginx grep -r client_max_body_size /etc/nginx/conf.d/
If the rendered nginx config still shows the old value, the containers did not pick up the new .env — re-run docker compose up -d from the change procedure above to recreate them.