0
3

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

.htaccessでのIPアドレスのブロック(プロキシーサーバやロードバランサー経由の場合)

Last updated at Posted at 2020-09-13

 プロキシーサーバやロードバランサー経由でサーバにアクセスされた場合は、接続元IPアドレスがそれらの機器のものとなる為、通常のブロックの書き方では対応できない。

.htaccess
order allow,deny
allow from all
deny from 255.255.255.255

 その場合は「X-Forwarded-For」を使用する。

.htaccess
SetEnvIf X-Forwarded-For “255\.255\.255\.255” denied_ip
 
order allow,deny
allow from all
deny from env=denied_ip

備考

 本記事はブログ「雑用エンジニアの技術ノート」からの移行記事です。先のブログは削除予定です。

0
3
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
0
3

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?