最新消息: 新版网站上线了!!!

linxu nginx配虚拟目录支持php环境

  1. location /user { 
  2.         alias /home/wwwroot/img; 
  3.         index index.php index.html index.htm; 
  4.  
  5.         location ~ ^/user/(.+.php)$ { 
  6.             alias /home/wwwroot/img/$1; 
  7.             fastcgi_pass  unix:/tmp/php-cgi.sock; 
  8.             include fastcgi_params; 
  9.             fastcgi_index index.php; 
  10.             fastcgi_param SCRIPT_FILENAME /home/wwwroot/img/$1; 
  11.  
  12.  
  13.         } 
  14.  
  15.         location ~* ^/user/(.+.(jpg|jpeg|gif|css|png|js|ico|html|xml|txt|swf))$ { 
  16.                 alias /home/wwwroot/img/$1; 
  17.         } 
  18.         if (!-e $request_filename){ 
  19.                         rewrite ^/(.*) /user/index.php last; 
  20.                     } 
  21.     } 

 

转载请注明:谷谷点程序 » linxu nginx配虚拟目录支持php环境