Error 413 when uploading pictures >8MB #8794

Closed
opened 2025-12-29 20:41:15 +01:00 by adam · 4 comments
Owner

Originally created by @PaulR282 on GitHub (Nov 1, 2023).

NetBox version

v3.6.4

Python version

3.10

Steps to Reproduce

  1. Increase FILE_UPLOAD_MAX_MEMORY_SIZE (I have also increased DATA_UPLOAD_MAX_MEMORY_SIZE) to more than 10MB
  2. Attach an Image that is bigger than 8MB to a rack

Expected Behavior

The image should be uploaded

Observed Behavior

The connection was reset
The log says 413

Originally created by @PaulR282 on GitHub (Nov 1, 2023). ### NetBox version v3.6.4 ### Python version 3.10 ### Steps to Reproduce 1. Increase `FILE_UPLOAD_MAX_MEMORY_SIZE` (I have also increased `DATA_UPLOAD_MAX_MEMORY_SIZE`) to more than 10MB 2. Attach an Image that is bigger than 8MB to a rack ### Expected Behavior The image should be uploaded ### Observed Behavior `The connection was reset` The log says 413
adam closed this issue 2025-12-29 20:41:16 +01:00
Author
Owner

@squintfox commented on GitHub (Nov 1, 2023):

@PaulR282 Are you using netbox-docker by chance?

@squintfox commented on GitHub (Nov 1, 2023): @PaulR282 Are you using netbox-docker by chance?
Author
Owner

@PaulR282 commented on GitHub (Nov 1, 2023):

@PaulR282 Are you using netbox-docker by chance?

Yes, I am.

@PaulR282 commented on GitHub (Nov 1, 2023): > @PaulR282 Are you using netbox-docker by chance? Yes, I am.
Author
Owner

@squintfox commented on GitHub (Nov 1, 2023):

We went through the same thing. It's not a NetBox issue, it's a web server setting in the docker config. You need to add this setting to the docker/nginx-unit.json file.

"settings": {
  "http": {
    "max_body_size": <int in bytes>
  }
}

Then you need to rebuild the container and have the file copied over. We did something like this in the Dockerfile:

COPY docker/nginx-unit.json /etc/unit/

That's been working for us nicely.

@squintfox commented on GitHub (Nov 1, 2023): We went through the same thing. It's not a NetBox issue, it's a web server setting in the docker config. You need to add this setting to the docker/nginx-unit.json file. ``` "settings": { "http": { "max_body_size": <int in bytes> } } ``` Then you need to rebuild the container and have the file copied over. We did something like this in the Dockerfile: `COPY docker/nginx-unit.json /etc/unit/` That's been working for us nicely.
Author
Owner

@PaulR282 commented on GitHub (Nov 1, 2023):

We went through the same thing. It's not a NetBox issue, it's a web server setting in the docker config. You need to add this setting to the docker/nginx-unit.json file.

"settings": {
  "http": {
    "max_body_size": <int in bytes>
  }
}

Then you need to rebuild the container and have the file copied over. We did something like this in the Dockerfile:

COPY docker/nginx-unit.json /etc/unit/

That's been working for us nicely.

Ok, Thanks. I will try it out tomorrow

@PaulR282 commented on GitHub (Nov 1, 2023): > We went through the same thing. It's not a NetBox issue, it's a web server setting in the docker config. You need to add this setting to the docker/nginx-unit.json file. > > ``` > "settings": { > "http": { > "max_body_size": <int in bytes> > } > } > ``` > > Then you need to rebuild the container and have the file copied over. We did something like this in the Dockerfile: > > `COPY docker/nginx-unit.json /etc/unit/` > > That's been working for us nicely. Ok, Thanks. I will try it out tomorrow
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#8794