这种方式的配置可以使用 delete , put 等方法了,但是只能访问 http://rest.website.com/,其它路径不能访问
server {
listen 80;
server_name rest.website.com;
root /website/public/;
index index.php;
location / {
include fastcgi.conf;
fastcgi_index index.php;
fastcgi_pass 127.0.0.1:9000;
}
}
这种方式可以访问其它路径,但是不能用 delete , put 等方法,只要 nginx 认为是访问的文件,就不能使用 delete , put 等方法
server
{
listen 80;
server_name rest.website.com ;
index index.php;
root /website/public/;
location / {
try_files $uri $uri/ /index.php$is_args$args;
}
location ~ .*\.php?$ {
try_files $uri =404;
fastcgi_index index.php;
include fastcgi.conf;
fastcgi_pass 127.0.0.1:9000;
}
}
搜索了一大圈没找到要怎么配置
1
zhengkai 2016-05-12 11:19:10 +08:00 1
无责任建议尝试一下 error_page 403 404 /index.php;
写在 location {} 之外 |
2
ryd994 2016-05-12 22:56:32 +08:00 1
全部由 index.php 处理么?
加上 fastcgi_param SCRIPT_FILENAME /full/path/to/index.php; 或者直接全局 rewrite 到 /index.php |