NGINX
次のような場所があります。
location ~ "^\/(place1|place2|...|place50)\/(service1|service2|...|service80)\-(else1|else2|...|else90)\/"
{...}
location ~ "^\/(word1|word2|...|word70)\/(place1|place2|...|place50)\-(else1|else2|...|else90)\/"
{...}
location ~ "^\/..."
問題は、多くの場所とサービスと言葉とその他があることです。したがって、場所は非常に長い文字列です。それらを短くすることは可能ですか?たぶん、大規模な場所と大規模なサービスなどですか?か何か?誰が経験がありますか?
一致させたいURIの例
/place23/service17-else87/
また
/world33/place42-else15/
と任意の組み合わせ
場所ごとに一連のルールを使用します。キャッシュを使用して Apache をアンロードするには
#proxy_cache start
set $do_not_cache 0;
# POST requests and urls with a query string should always go to PHP
if ($request_method = POST) {
set $do_not_cache 1;
}
if ($query_string != "") {
set $do_not_cache 1;
}
# Don't use the cache for logged in users or REBent commenters
if ($http_cookie ~* "wordpress_logged_in|bn_my_logged") {
set $do_not_cache 1;
}
if ($args ~* (show) ) {
set $do_not_cache 1;
}
ssi_types "*";
ssi on;
if ($do_not_cache = 0) {
set $memcached_key "SMREG|$request_uri";
memcached_pass memc_server;
ssi on;
}