当前位置:首页 > 开发 > 开源软件 > 正文

nginx有选择性进行限制

发表于: 2015-05-21   作者:ronin47   来源:转载   浏览:
摘要: 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)$ {
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有选择性进行限制

  • 0

    开心

    开心

  • 0

    板砖

    板砖

  • 0

    感动

    感动

  • 0

    有用

    有用

  • 0

    疑问

    疑问

  • 0

    难过

    难过

  • 0

    无聊

    无聊

  • 0

    震惊

    震惊

版权所有 IT知识库 CopyRight © 2009-2015 IT知识库 IT610.com , All Rights Reserved. 京ICP备09083238号