wangcaiwen 2011-11-07 20:28:24 4917次浏览 0条回复 0 0 0

yii为根目录 app为应用 gmop为要建立的虚拟目录

访问http://localhost/app/index.php 一切正常 但是访问http://localhost/gmop/index.php 就会出现问题。

server {
        listen       80;
        server_name  localhost;
        #charset koi8-r;
        #access_log  logs/host.access.log  main;
		location /gmop/ {
			alias e:/web/yii/app/;
			index index.html index.php;
			if (!-e $request_filename){
				rewrite ^/(.*) /app/index.php last;
			}
		}
        location / {
            root   e:/web/yii;
            index  index.html index.htm index.php;
			rewrite  ^/css/main.css$  http://$host/app/css/main.css;
			rewrite  ^/css/form.css$  http://$host/app/css/form.css;
			rewrite  ^/css/screen.css$  http://$host/gmop/css/screen.css;
			rewrite  ^/css/print.css$  http://$host/app/css/print.css;
			if (!-e $request_filename){  
				rewrite ^/(.*) /app/index.php last;  
			}  
        }
		location ~ ^/gmop/.*\.php$ {
			root   e:/web/yii/;
			rewrite /(.*)/(.*\.php?) /$2 break;
            fastcgi_pass   127.0.0.1:9000;
            fastcgi_index  index.php;
            fastcgi_param  SCRIPT_FILENAME  e:/web/yii/app$fastcgi_script_name;
            include        fastcgi_params;
		}
		
		location ~ \.php$ {
            #root   e:/web/yii;
            fastcgi_pass   127.0.0.1:9000;
            fastcgi_index  index.php;
            fastcgi_param  SCRIPT_FILENAME  e:/web/yii$fastcgi_script_name;
            include        fastcgi_params;
        }
    没有找到数据。
您需要登录后才可以回复。登录 | 立即注册