nginx-proxy-manager icon indicating copy to clipboard operation
nginx-proxy-manager copied to clipboard

[Feature Request] Support for rate limiting

Open nfacha opened this issue 6 years ago • 12 comments

Allow to configure NGINX rate limits from the UI

nfacha avatar Apr 06 '19 22:04 nfacha

Any updates on this? @jc21

Any updates on this? @jc21

dedarh avatar Mar 01 '21 20:03 dedarh

Any updates on this? @jc21

JackBailey avatar Jan 26 '22 12:01 JackBailey

For everyone who wants to implement it partially without UI: you can use the option for advanced configuration.

  1. Create the file /data/nginx/custom/http_top.conf (maybe mounted elsewhere so check your docker volumes)
  2. Edit the file and insert the line limit_req_zone $binary_remote_addr zone=mylimit:10m rate=3r/s; (can be changed to your needs and multiple zones are possible). Save and close the file
  3. Restart NPM and open the Web UI
  4. Edit the Proxy Host and under advanced you can add this code (example for Jellyfin):
location /Users/authenticatebyname {
	limit_req zone=mylimit burst=8 delay=6;
	proxy_pass http://$server:$port;
}
  1. Edit the location, burst and delay (maybe change the scheme to https if needed)
  2. Save the changes, it should still show "online"

More information about the configuration on the offical nginx page

I use this setup for Jellyfin and filebrowser and it works fine for me.

ArmJo avatar Feb 24 '22 09:02 ArmJo

Just wanted to add that this feature would be very helpful for me as well. The custom http_top config works wonders but having the custom location in the advanced section isn't the cleanest approach. Even if there was a one line field that would allow you to insert the limit_req parameters in the existing location directive, that would be sweet.

cardtap avatar Oct 20 '22 15:10 cardtap

hello, another "yes please me too" comment...

After having a look at the network traffic and being horrified I would also suggest having this as a priority. The whole point of NPM is to take away the pain of manually messing with nginx config and a built in rate limit / fail2ban functionality would be very welcome.

Cheers

geez0r avatar Jan 05 '23 12:01 geez0r

location /Users/authenticatebyname {
   limit_req zone=mylimit burst=8 delay=6;
   proxy_pass http://$server:$port;
}

This is not working for my nextcloud instance (it gave the untrusted domain error), however, this does work:

location /Users/authenticatebyname {
    limit_req zone=mylimit burst=8 delay=6;
    include conf.d/include/proxy.conf;
}

Robin-Sch avatar Jun 16 '23 13:06 Robin-Sch

I wonder why this issue still open

TornadoRadon avatar Nov 14 '23 09:11 TornadoRadon

Do you have any plans to address this issue? I am strongly requesting this feature.

unitea1992 avatar Jan 28 '24 15:01 unitea1992

Hi, I personally use Nginx Proxy Manager to publicly host services. I would really appreciate it if this could get implemented to prevent DDoS attacks and possibly filling up all of the available traffic.

AlexPewMaster avatar Apr 09 '24 12:04 AlexPewMaster

Any plans on supporting this in a near future? :eyes:

aminnairi avatar Jul 11 '24 09:07 aminnairi

location /Users/authenticatebyname {
   limit_req zone=mylimit burst=8 delay=6;
   proxy_pass http://$server:$port;
}

This is not working for my nextcloud instance (it gave the untrusted domain error), however, this does work:

location /Users/authenticatebyname {
    limit_req zone=mylimit burst=8 delay=6;
    include conf.d/include/proxy.conf;
}

I did it like this and it works

location /Users/authenticatebyname {
   limit_req zone=mylimit burst=8 delay=6;
   proxy_pass http://$server:$port;
}

but how can I do it for the entire website?

using

location / {

will not work. When i try to open any /subpage it will try to pass the connection to the private IP of the docker container

Also, do you know how to implement it correctly with Cloudflare so that it does not rate limit the Cloudflare IPs, but instead it checks the REAL IPs?

NazgulCoder avatar Aug 22 '24 15:08 NazgulCoder

Any updates on this? I'm in need of a rate limit setting.

presotto-m avatar Feb 07 '25 20:02 presotto-m

Any plans to add rate limit support ?

mourraille avatar Apr 07 '25 14:04 mourraille

any updates ?

0xc0000f avatar May 15 '25 13:05 0xc0000f