地方エンジニアの学習日記

興味ある技術の雑なメモだったりを書いてくブログ。たまに日記とガジェット紹介。

【Nginx】1.28.0が出ていた

nginx.org

nginx-1.28.0 stable version has been released, incorporating new features and bug fixes from the 1.27.x mainline branch  — including memory usage and CPU usage optimizations in complex SSL configurations, automatic re‑resolution of hostnames in upstream groups, performance enhancements in QUIC, OCSP validation of client SSL certificates and OCSP stapling support in the stream module, variables support in the proxy_limit_rate, fastcgi_limit_rate, scgi_limit_rate, and uwsgi_limit_rate directives, the proxy_pass_trailers directive, and more.

uwsgi_limit_rateで変数が使えるようになったらしいのが気になりポイント。以下のように使える機能っぽいが例えばパス単位でクライアントとかを判定している場合に特定クライアントだけは帯域制限をかけるということができるWebSocketとかを使っている場合に前段に置いておく事で特定クライアントが帯域を使い切るみたいなことはなく行けるのかも?と思ったりした。ちょっと試してみよう。

http {
    server {
        listen 80;

        location / {
            # uWSGIのリクエスト制限を設定
            uwsgi_pass 127.0.0.1:8000;

            # 帯域幅制限(例:1MB/s)
            limit_rate 1024k;

            # その他の設定
            include uwsgi_params;
        }
    }
}

github.com