nginx有选择性进行限制

http {
    limit_conn_zone $binary_remote_addr zone=addr:10m;
    limit_req_zone $binary_remote_addr zone=one:10m rate=5r/s;...

    server {...
       location ~.*\.(gif|png|css|js|icon)$ {
            proxy_set_header Host $http_host;
            proxy_set_header X-Real_IP $remote_addr;
            proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;}

        location ~*.*\.(jpeg|jpg|JPG)$ {
            proxy_set_header Host $http_host;
            proxy_set_header X-Real_IP $remote_addr;
            proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;#    image_filter resize 480 -;#    image_filter_jpeg_quality 50;#    image_filter_sharpen 10;#    image_filter_buffer 4M;}

        location /{
            proxy_set_header Host $http_host;
            proxy_set_header X-Real_IP $remote_addr;
            proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;#limit
            limit_conn addr 3;
            limit_req zone=one burst=5;}}

你可能感兴趣的:(nginx 动静 限制)