LoginSignup
3
6

More than 5 years have passed since last update.

Nginxでメソッド制限

Posted at

Nginxで許可するメソッドを制限する方法

limit_exceptで簡単に許可するメソッドを制限できる

location / {
    limit_except GET HEAD POST { deny all; }
}

複数locationに設定したい場合

serverディレクティブにこのように書いてあげると良い

        if ($request_method !~ ^(GET|HEAD|POST)$ ) {
                return 444;
        }

参考

3
6
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
3
6