1
搜索了半天也沒找到答案,謝謝你先在這裏笨在WordPress的如何配置Nginx的
這裏是我的目錄: 的WordPress在/var/projects/root
笨在/var/projects/root/codeigniter/
這裏是我的nginx服務器配置:
listen 80;
server_name nginx.local.com;
root /var/projects/root;
error_log /var/projects/log/error.log warn;
access_log /var/projects/log/access.log main;
if ($host != 'nginx.local.com'){
rewrite ^/(.*) http://nginx.local.com/$1 permanent;
}
location/{
index index.php index.html index.html;
}
rewrite ^.*/files/(.*)$ /wp-includes/ms-files.php?file=$1 last;
if (!-e $request_filename) {
rewrite ^.+?(/wp-.*) $1 last;
rewrite ^.+?(/.*\.php)$ $1 last;
rewrite^/index.php last;
}
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;
}
location ~ /codeigniter/ {
if (!-e $request_filename)
{
rewrite ^/(.*)$ /index.php/$1 last;
break;
}
}
location /codeigniter {
try_files $uri $uri/ /codeigniter/index.php?$query_string;
}
我已經嘗試了很多方法,該笨已經成爲原代碼,現在只有http://nginx.local.com/codeigniter
和http://nginx.local.com/codeigniter/index.php
可以訪問(歡迎頁)
以下頁面是404 Not Found
http://nginx.local.com/index.php/codeigniter/welcome/index
http://nginx.local.com/codeigniter/welcome/index
http://nginx.local.com/index.php/codeigniter/welcome/test