• Please be aware: Kaspersky Anti-Virus has been deprecated
    With the upgrade to Plesk Obsidian 18.0.64, "Kaspersky Anti-Virus for Servers" will be automatically removed from the servers it is installed on. We recommend that you migrate to Sophos Anti-Virus for Servers.
  • The Horde webmail has been deprecated. Its complete removal is scheduled for April 2025. For details and recommended actions, see the Feature and Deprecation Plan.
  • We’re working on enhancing the Monitoring feature in Plesk, and we could really use your expertise! If you’re open to sharing your experiences with server and website monitoring or providing feedback, we’d love to have a one-hour online meeting with you.

Question Rate limiting on Ngnix

Html

New Pleskian
How do I use Ngnix rate limits?
Code:
limit_req_zone $binary_remote_addr zone=mylimit:10m rate=10r/s;
server {
    location /login/ {
        limit_req zone=mylimit;
        proxy_pass http://my_upstream;
    }
}
in the additional Nginx directive of Plesk???
I just tried this...

Server directory is not allowed here...

How should I use this properly?
 
I cant understand, why of a question the user shull open a login form? He was logged in, otherwise he cant write! More interessting is, why a feature, they is written in Nginx documentation in 2017 on page nginx - blog rate-limiting-nginx in plesk in the newest version of plesk in the year 2020 (so 3 years later) not function?
Equal many times plesk offer a high security, but this not given! Today many users have change to newest php versions and to nginx, but nothing is done in punto security in plesk, but nginx can handle many of this features, but they cant set in plesk and btw all scripts for fail2ban and nginx are missing too! So server admins, they change their users from apache to nginx shut of the security, the in apache before exists!
 
There is no build-in functionality in Plesk to limit download speed for website files in Plesk. As a workaround, it can be performed by adding the additional directives for corresponding services. In this instruction download speed will be limited to the 350 Kb/s.

If static files are served by Nginx:

Note: this instruction should be used if Serve static files directly by nginx is enabled, or Proxy mode is disabled in Domains > example.com > Apache & nginx Settings.
  1. Go to Domains > example.com > Apache & nginx Settings.
  2. Add one of the configurations below into the Additional nginx directives field:
    • To limit download speed for the whole website:
      Code:
      limit_rate 350k;
    • To limit download speed for all files in downloads folder and all its subfolders:
      Code:
      location /downloads {
      limit_rate 350k;
      }
  3. Press the OK button to apply changes.
 
The nginx limit_req directive can be included at /etc/nginx/nginx.conf inside http block.


NGINX:
http {
........

    limit_req_zone $binary_remote_addr zone=mylimit:10m rate=10r/s;
..........   
}


Then, the limit_"req zone=mylimit;" can be included in the plesk Additional nginx directives at proper location

NGINX:
    location /login/ {
        limit_req zone=mylimit;
    }
 
Back
Top