!<br><br> ݣ      !   .<br><br> ,        nginx   .<br><br>   "<a href="http://example.com/test/%D1%80%D0%B0%D1%88%D1%88%D0%BD">http://example.com/test/</a>" :<br>
<br>$document_uri: /test/<br>$request: GET /test/%D1%80%D0%B0%D1%88%D1%88%D0%BD HTTP/1.1<br>$request_uri: /test/%D1%80%D0%B0%D1%88%D1%88%D0%BD<br>$uri: /test/<br>/test(/.*): /<br><br>,          .  -  urlencode()  php.<br>
   nginx   ۣ,   ,      ,     set. ,  :<br>set $uri_encoded $uri;<br> $uri_encoded  ! ..     , set   .<br>
<br> ,  .   ģ         :<br><br>location ~ /purge(/.*) {<br>  set $uri_encoded $1; #  <br>  fastcgi_cache_purge MAGE "$scheme$request_method$host$uri_encoded$is_args$args";<br>
}<br><br>      nginx :)<br><br><div class="gmail_quote">2012/12/17 VovansystemS <span dir="ltr"><<a href="mailto:vovansystems@gmail.com" target="_blank">vovansystems@gmail.com</a>></span><br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"> !<br><br>    wordpress    ngx_http_fastcgi_module,     .<br>
   ,        .      wordpress   nginx-helper,          <a href="http://example.com/purge/news/001" target="_blank">http://example.com/purge/news/001</a>    <a href="http://example.com/news/001" target="_blank">http://example.com/news/001</a> (      ). <br>

<br>    ,           ,  ,     .    ,          ޣ,  uri    %D0%B8%D0%BC%D1%8F_%D1%81%D1%82%D1%80%D0%B0%D0%BD%D0%B8%D1%86%D1%8B,           /purge/_,    location ~ /purge(/.*)   uri "_"      - ..       .<br>

<br>       ,       .   -   ?<br><br><br>Linux example 2.6.32-042stab049.7 #1 SMP Thu Mar 1 18:03:05 MSK 2012 x86_64 GNU/Linux<br>

nginx version: nginx/1.2.6<br><br>:<br><br>fastcgi_cache_path /tmp/fcgi levels=1:2 keys_zone=MAGE:32m max_size=64m inactive=10h;<br><br>server {<br> listen 80;<br> server_name <a href="http://example.com" target="_blank">example.com</a> <a href="http://www.example.com" target="_blank">www.example.com</a>;<br>

 charset utf-8;<br> error_log off; access_log off;<br> <br> root /home/user/<a href="http://example.com" target="_blank">example.com</a>;<br> index index.php index.html index.htm;<br> <br> set $no_cache 0;<br>

<br> # POST requests and urls with a query string should always go to PHP<br> if ($request_method = POST) {<br> set $no_cache 1;<br> } <br><br> if ($query_string != "") {<br> set $no_cache 0;<br>

 } <br><br> # Don't cache uris containing the following segments<br> if ($request_uri ~* "(/wp-admin/|/xmlrpc.php|/wp-(app|cron|login|register|mail).php|wp-.*.php|/feed/|index.php|wp-comments-popup.php|wp-links-opml.php|wp-locations.php|sitemap(_index)?.xml|[a-z0-9_-]+-sitemap([0-9]+)?.xml)") {<br>

 set $no_cache 1;<br> } <br><br> # Don't use the cache for logged in users or recent commenters<br> if ($http_cookie ~* "comment_author|wordpress_[a-f0-9]+|wp-postpass|wordpress_no_cache|wordpress_logged_in") {<br>

 set $no_cache 1;<br> }<br> <br> location / {<br> # This is cool because no php is touched for static content.<br> # include the "?$args" part so non-default permalinks doesn't break when using query string<br>

 try_files $uri $uri/ /index.php?$args;<br> }<br> # all other .php files<br> location ~ \.php$ {<br><br> try_files $fastcgi_script_name =404;<br> include fastcgi_params;<br> fastcgi_pass unix:/var/run/fpm-v.sock;<br>

 <br> fastcgi_cache_bypass $no_cache;<br> fastcgi_no_cache $no_cache;<br><br> fastcgi_index index.php;<br> fastcgi_intercept_errors off;<br> fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;<br>

 fastcgi_temp_path /tmp/fcgi2 1 2;<br> fastcgi_cache MAGE;<br> fastcgi_cache_key "$scheme$request_method$host$request_uri";<br> fastcgi_ignore_headers "Cache-Control" "Expires" "Set-Cookie";<br>

 fastcgi_cache_min_uses 1;<br> fastcgi_cache_valid 30m;<br> fastcgi_cache_use_stale updating error timeout invalid_header http_500;<br> }<br><br> location ~ /purge(/.*) {<br> #default_type text/plain;<br>

 #echo "fastcgi_cache_purge MAGE $scheme$request_method$host$1$is_args$args";<br> #echo "fastcgi_cache_key $scheme$request_method$host$request_uri"; <br> fastcgi_cache_purge MAGE "$scheme$request_method$host$1$is_args$args";<br>

 } <br><br> location ~* ^.+\.(ogg|ogv|svg|svgz|eot|otf|woff|mp4|ttf|rss|atom|jpg|jpeg|gif|png|ico|zip|tgz|gz|rar|bz2|doc|xls|exe|ppt|tar|mid|midi|wav|bmp|rtf)$ {<br> access_log off; log_not_found off; expires max;<br>

 }<br><br>}<br>
</blockquote></div><br>