Skip to content

[BUG] nginx won't let you import file because of size #268

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
1 task done
marcosxaviergil opened this issue Mar 17, 2025 · 3 comments
Open
1 task done

[BUG] nginx won't let you import file because of size #268

marcosxaviergil opened this issue Mar 17, 2025 · 3 comments

Comments

@marcosxaviergil
Copy link

Is there an existing issue for this?

  • I have searched the existing issues

Current Behavior

when trying to import a book in zip format nginx gives an error. Even using the variables below for bookstack and php:
- FILE_UPLOAD_SIZE_LIMIT=200
- post_max_size = 200M
- upload_max_filesize = 200M

Expected Behavior

allow changing nginx limits with environment variables

Steps To Reproduce

export a zip file 50 mb book from a bookstack instance and import . error happens on upload

Environment

- OS:
- How docker service was installed:

CPU architecture

x86-64

Docker creation

---
services:

  bookstack:
    image: linuxserver/bookstack:25.02.20250309
    environment:
      - APP_URL=***********
      - APP_KEY=**************
      - DB_HOST=*************
      - DB_DATABASE=**********
      - DB_USERNAME=*****************
      - DB_PASSWORD=**************
      - PUID=1000
      - PGID=1000
      - TZ=America/Sao_Paulo
      - APP_LANG=pt_BR
      - APP_DEBUG=true
      - ALLOWED_IFRAME_SOURCES="*"
      - SAML2_DUMP_USER_DETAILS=true
      - FILE_UPLOAD_SIZE_LIMIT=200
      - post_max_size = 200M
      - upload_max_filesize = 200M

#
      - AUTH_METHOD=ldap
      - LDAP_SERVER=ldap:************
      - LDAP_BASE_DN="**********"
      - LDAP_DN="cn=ldapbookstack,ou=serviceusers,**********"
      - LDAP_PASS="***********"
      - LDAP_USER_FILTER=(&(mail={user}))
      - LDAP_VERSION=3
      - LDAP_ID_ATTRIBUTE=mail
      - LDAP_EMAIL_ATTRIBUTE=mail
      - LDAP_DISPLAY_NAME_ATTRIBUTE=firstNames
      - LDAP_THUMBNAIL_ATTRIBUTE=jpegphoto
      - LDAP_START_TLS=true
      - LDAP_TLS_INSECURE=true
#
      - MAIL_DRIVER=smtp
      - MAIL_HOST=************
      - MAIL_PORT=*********
      - MAIL_ENCRYPTION=tls
      - MAIL_USERNAME=*************
      - MAIL_PASSWORD=************
      - MAIL_FROM=****************
      - MAIL_FROM_NAME=*************

    volumes:
      - uploads:/var/www/bookstack/public/uploads
      - storage-uploads:/var/www/bookstack/storage/uploads
    ports:
      - 8084:80
    networks:
      - local

volumes:
  uploads:
  storage-uploads:

networks:
  local:
    driver: overlay

Container logs

keep running


Actions

      

[migrations] started

[migrations] 01-nginx-site-confs-default: executing...

[migrations] 01-nginx-site-confs-default: succeeded

[migrations] 02-default-location: executing...

[migrations] 02-default-location: succeeded

[migrations] done

───────────────────────────────────────

      ██╗     ███████╗██╗ ██████╗

      ██║     ██╔════╝██║██╔═══██╗

      ██║     ███████╗██║██║   ██║

      ██║     ╚════██║██║██║   ██║

      ███████╗███████║██║╚██████╔╝

      ╚══════╝╚══════╝╚═╝ ╚═════╝

   Brought to you by linuxserver.io

───────────────────────────────────────

To support LSIO projects visit:

https://www.linuxserver.io/donate/

───────────────────────────────────────

GID/UID

───────────────────────────────────────

User UID:    1000

User GID:    1000

───────────────────────────────────────

Linuxserver.io version: v25.02-ls196

Build-date: 2025-03-09T13:52:48+00:00

───────────────────────────────────────

    

Setting resolver to  127.0.0.11

Setting worker_processes to 12

generating self-signed keys in /config/keys, you can replace these with your own keys if required

....+...+..+.......+...+.....+...+.+......+...............+.........+...+.....+.+..+...+.+...............+.........+......+.....+...+++++++++++++++++++++++++++++++++++++++*..+.+..+...+.............+.....+.+...+.....+......+.......+.................+...+...+.........+.......+.....+.+...............+++++++++++++++++++++++++++++++++++++++*.......+..+...+................++++++

.+.......+........+.+...+..+++++++++++++++++++++++++++++++++++++++*.+...+......+......+.+...+.....+.+...+..+.+..+...+.......+++++++++++++++++++++++++++++++++++++++*....+.......+..+.+........+......+...+.+...........+...+......+.+...........+.......+...........+.+......+..+.......+.....+.+.........+...+...+...+..+...+.........+...............+...............+.+......+........+.+...........+...+.+.....+....+...+.....++++++

-----

Waiting for DB to be available

   INFO  Nothing to migrate.  

[custom-init] No custom files found, skipping...

[ls.io-init] done.
Copy link

Thanks for opening your first issue here! Be sure to follow the relevant issue templates, or risk having this issue marked as invalid.

@ssddanbrown
Copy link
Contributor

These options:

post_max_size = 200M
upload_max_filesize = 200M

Would go in your php/php-local.ini file that should exist in your mounted /config volume folder.
They are not env options.
You may need to restart the container for these changes to take affect.

WARNING: I noticed your existing volumes are strange:

    volumes:
      - uploads:/var/www/bookstack/public/uploads
      - storage-uploads:/var/www/bookstack/storage/uploads

Those are not container paths used by this container image.
This should be fixed to align with the guidance/paths for this image.
Be very careful, if you've created data (uploaded files/images/attachments) you can very easily loose data here.
Don't take down the stack before you're sure the files are safe, if you have important existing files.
You may need to export the contents of the existing container to retain these files.

@LinuxServer-CI
Copy link
Collaborator

This issue has been automatically marked as stale because it has not had recent activity. This might be due to missing feedback from OP. It will be closed if no further activity occurs. Thank you for your contributions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Issues
Development

No branches or pull requests

3 participants