【发布时间】:2015-07-24 19:35:51
【问题描述】:
你好 StackOverflowers,
我在这个问题上挣扎了一天多。我有2个站点,一个是应用程序,一个是前端wordpress。
文件如下:
- 应用程序:C:/Users/NICOLAS/Documents/www/index.php
- Wordpress:C:/Users/NICOLAS/Documents/www/wordpress/index.php
问题是我正在从 apache 迁移到 nginx,我无法更改 URL。映射必须是这样的:
- 应用程序:http://test.site/v1/index.php/products/view/shoes 必须得到
- www/index.php/products/view/shoes
- Wordpress : http://test.site/index.php 必须得到
- www/wordpress/index.php
我未能配置 NginX 来执行此操作。不知道为什么,这个配置让我头疼!我仍然不明白 NginX 的逻辑。这是我的 conf 的重要部分:
root C:\Users\NICOLAS\Documents\www;
location ~ ^/v1/(.+\.php.*)$ {
alias "C:/Users/NICOLAS/Documents/www/$1";
location ~ \.php$ {
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $request_filename;
include fastcgi_params;
}
}
location ~ / {
alias C:/Users/NICOLAS/Documents/www/wordpress/;
location ~ \.php$ {fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
}
你能指出我的错误在哪里吗?
谢谢!
【问题讨论】: