@kyanny's blog

My thoughts, my life. Views/opinions are my own.

squid.conf メモ(acl, http_access, no_cache, always_direct)

squid は acl を単位にして設定していくものらしい。

acl はこんな風に定義する。

acl FOO url_regex foo$ # url に foo$ が含まれる場合にマッチ
acl BAR urlpath_regex -i ^/bar # url の path 部分に ^/bar が含まれる場合にマッチ、大文字小文字の区別なし
acl BAZ referer_regex -i ^http://\.example\.com # リファラが http://example.com を含む場合にマッチ

アクセス制限は http_access で設定する。

acl img urlpath_regex -i ^/img
acl check_referer referer_regex -i ^http://example\.com
http_access deny img !check_referer # img かつ check_referer でない条件にマッチしたときのみ、 deny する(403 を返す)

no_cache, always_direct などの設定もある、がこちらはうまく使えなかった。

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy