被难住了,在nginx中配置虚拟目录使用yii [ 新手入门 ]
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;
}
共 0 条回复
没有找到数据。
wangcaiwen
注册时间:2011-09-17
最后登录:2017-01-06
在线时长:0小时3分
最后登录:2017-01-06
在线时长:0小时3分
- 粉丝0
- 金钱10
- 威望0
- 积分10