mirror of
https://github.com/NginxProxyManager/nginx-proxy-manager.git
synced 2026-04-25 01:15:51 +03:00
[GH-ISSUE #93] Set client_max_body_size and other Nginx configrations #83
Labels
No labels
awaiting feedback
bug
cannot reproduce
dns provider request
duplicate
enhancement
enhancement
enhancement
good first issue
help wanted
invalid
need more info
no certbot plugin available
product-support
pull-request
question
stale
troll
upstream issue
v2
v2
v2
v3
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/nginx-proxy-manager-NginxProxyManager#83
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @relink2013 on GitHub (Mar 4, 2019).
Original GitHub issue: https://github.com/NginxProxyManager/nginx-proxy-manager/issues/93
I need to add a
client_max_body_size 10000m;to one of my proxy hosts, but there seems to be no obvious way to do it. I tried adding it directly to the .conf file, but it did not work.@jc21 commented on GitHub (Mar 5, 2019):
At the moment you can't. But I'll convert this to a future feature.
@ghzgod commented on GitHub (Mar 7, 2019):
So what is the work around for this? My nextcloud photo uploads are so slow.
@UniverseM5 commented on GitHub (Mar 23, 2019):
I also have a lot of customisations in nginx.conf file (e.g. add_header, ssl_, gzip_, proxy_, auth_basic_ etc.). Not being able set it manually in the Manager is stopping me from moving to here. Otherwise, idea/app is brilliant. Thanks.
@niklasdahlheimer commented on GitHub (Mar 25, 2019):
Hey
Great app so far!
I also need to edit the nginx.conf and add
client_max_body_size 0to prevent a timeout while uploading a lot of data at once
Seems like the nginx.conf is not part of the mountable /conf folder. Is there any way to edit the nginx.conf via SSH opening a bash in the container?
@jc21 commented on GitHub (Mar 27, 2019):
For the time being here's a hack:
Connect to your already running NPM container with
and then
So what you just did was enter the running container filesystem and copy the built-in
nginx.conffile to your mounted data folder.Now you have to bring down your docker containers and forcibly mount the
nginx.conffile over the top of the built in one. You'll have to edit yourdocker-compose.ymlfile or however you run your container to mount it:Make changes to your version of the config and restart the container to take effect.
@allebb commented on GitHub (Apr 19, 2019):
@relink2013 @niklasdahlheimer I added
client_max_body_size 0;to the "Advanced" tab and seems to be working just fine for my Nextcloud and Minio services that sit behind my proxy.@zeighy commented on GitHub (Apr 20, 2019):
literally looking this up because I'm having issues where big downloads/uploads getting cut off "mysteriously" on my nextcloud (in unraid) found your settings and copied them over (with some adjustments) and the issues magically went away. :P thanks!
Looks like the advanced tab comes in real handy
@allebb commented on GitHub (Apr 24, 2019):
No worries @zeighy - I'm glad I was able to be of help 👍
@lordraiden commented on GitHub (Apr 24, 2019):
@jc21 Can I add all this to the advanced tab, or it will break things?
This is suppose to be a hardened configuration, ideally this could be configure at some point in the future from the interface with drop down menus, etc and links to the official nginx doc.
This is a good source of a hardened configuration https://gist.github.com/plentz/6737338 although the one below is a little bit more restrictive (secure), I think.
Maye you could start by adding this options to the interface
`
Basic Proxy Config
proxy_set_header Host $host:$server_port;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto https;
proxy_set_header X-Forwarded-Host $host;
proxy_set_header X-Forwarded-Ssl on;
proxy_redirect http:// $scheme://;
proxy_http_version 1.1;
proxy_set_header Connection "";
#proxy_cookie_path / "/; HTTPOnly; Secure"; # enable at your own risk, may break certain apps
proxy_cache_bypass $cookie_session;
proxy_no_cache $cookie_session;
proxy_buffers 32 4k;
Custom Proxy config hardening
proxy_hide_header X-Powered-By;
add_header Content-Security-Policy "upgrade-insecure-requests";
add_header X-Frame-Options "SAMEORIGIN";
add_header X-XSS-Protection "1; mode=block" always;
add_header X-Content-Type-Options "nosniff" always;
add_header Cache-Control "no-transform" always;
add_header Referrer-Policy no-referrer always;
add_header X-Robots-Tag none;
#add_header X-UA-Compatible "IE=Edge" always;`
protocols
ssl_protocols TLSv1.2;
ssl_prefer_server_ciphers on;
Custom settings hardening
ssl_ciphers 'EECDH+AESGCM:EDH+AESGCM:AES256+EECDH:AES256+EDH';
HSTS, remove # from the line below to enable HSTS
add_header Strict-Transport-Security "max-age=63072000; includeSubDomains; preload" always;
OCSP Stapling
ssl_stapling on;
ssl_stapling_verify on;
@millercentral commented on GitHub (Dec 2, 2022):
This is marked completed, but when I add
client_max_body_size 10000M;to my custom config in NPM is brings down the Proxy Host. Is there any details on how to add this config via the UI (as opposed to the workaround to override the .conf file)?@pppfz commented on GitHub (Dec 25, 2024):
Hey, hello, I'm very sorry to bother you. I want to ask you a question. Why can't it work successfully after I followed the method?
1. First, my docker-compose.yml is as follows:
2. I added two Proxy Hosts
I successfully found their configuration at: ./npm/data/nginx/proxy_host/1.conf or 2.conf
Their configuration content is:
The first one (conf after removing sensitive data and adding advanced configuration in the panel)
The second one (conf after removing sensitive data and adding advanced configuration in the panel)
Give other information
@ratulSharker commented on GitHub (Feb 9, 2025):
Adding only the following works for me:
@VictorRomano commented on GitHub (Jul 21, 2025):
This worked for me, thanks!
@azaloum90 commented on GitHub (Feb 15, 2026):
Thank you for this, saved me on my next cloud instance as it did for some other posters!