1. 程式人生 > >nginx rewrite 引數和例子

nginx rewrite 引數和例子

  1. location ^~ /ucenter {
  2.      location ~ .*/.php?$
  3.      {
  4.   #fastcgi_pass  unix:/tmp/php-cgi.sock;
  5.   fastcgi_pass  127.0.0.1:9000;
  6.   fastcgi_index index.php;
  7.   include fcgi.conf;     
  8.      }
  9.      location /ucenter/data/avatar {
  10. log_not_found off;
  11. access_log   off;
  12. location ~ /(.*)_big/.jpg$ {
  13.     error_page 404 /ucenter/images/noavatar_big.gif;
  14. }
  15. location ~ /(.*)_middle/.jpg$ {
  16.     error_page 404 /ucenter/images/noavatar_middle.gif;
  17. }
  18. location ~ /(.*)_small/.jpg$ {
  19.     error_page 404 /ucenter/images/noavatar_small.gif;
  20. }
  21. expires 300;
  22. break;
  23.      }
  24.                        }