Article

  • 10 months

    4 months

    YetiShare / Core

    4891

Set Upload/Download Speed & Concurrent Connections By User Type On Nginx

To support restricted upload speeds/connections by user type on Nginx, follow the guide below:

  • Via your script admin area, navigate to:
    • https://yoursite.com/admin/account_package_manage
  • Edit any of the packages.
  • At the bottom of "Upload Settings" edit "Upload Url Slug".
    • Set a unique string, without spaces or special characters, such as:
      • tempuser
  • Assuming you've set "tempuser", via your Nginx rewrite rules apply the following above any existing rules:

location /tempuser/ {
# limit upload/download speed to 50k limit_rate 50k;

# limit connections from the same IP address to 1
limit_conn addr 1; }

  • Edit your main Nginx config file. This is normally called nginx.conf. Add the following to the http section:
limit_conn_zone $binary_remote_addr zone=addr:10m;

  • Restart Nginx to apply the changes.
  • You can also use the above process to set the download speed/connections.

Reources: