end0tknr's kipple - web写経開発

太宰府天満宮の狛犬って、妙にカワイイ

amazon wsのELB配下のnginx.confでアクセス元のIPによる接続制限

例えば、AWS ELB配下では、次のように $http_x_forwarded_for で、nginx.confを書くようです。
まぁ、リバースプロキシな環境では、どれも同じノリになるはずですけど

# for pre-open closed test
map $http_x_forwarded_for $allowed {
    default deny;
    ~\s*111.222.333.444$ allow;
    ~\s*123.456.789.*$   allow;
}

location / {
    if ( $allowed = "deny" ) { return 403; }
    alias /path/to/document_root
}

http://nginx.org/en/docs/http/ngx_http_map_module.html