NGINX和Codeigniter:Uri不适用于index.php
嗨 我是一个完全的新手,现在已经用nginx和codeigniter建立了一个服务器。这是我的nginx配置文件,它在一定程度上起作用。当我输入时,我相信找到了codeigniter的index.php,因为显示了codeigniters routes.php的默认类。但我的问题是,当我将URI附加到URL时,它不起作用,例如: 我不知道去哪里查?这是nginx配置中的错误还是codeigniters index.php中的错误?但是我没有在index.php中更改任何内容 这是问这类问题的合适地方还是我应该去别的地方?我完全被困在这里,在书籍或谷歌搜索中找不到任何好的提示 谢谢你花时间 服务器{NGINX和Codeigniter:Uri不适用于index.php,php,codeigniter,nginx,Php,Codeigniter,Nginx,嗨 我是一个完全的新手,现在已经用nginx和codeigniter建立了一个服务器。这是我的nginx配置文件,它在一定程度上起作用。当我输入时,我相信找到了codeigniter的index.php,因为显示了codeigniters routes.php的默认类。但我的问题是,当我将URI附加到URL时,它不起作用,例如: 我不知道去哪里查?这是nginx配置中的错误还是codeigniters index.php中的错误?但是我没有在index.php中更改任何内容 这是问这类问题的合适
listen 80;
server_name = example.com;
charset utf-8;
access_log /var/log/nginx/log/weapp-access.log main;
error_log /var/log/nginx/log/weapp-error.log;
root /data/release/php-weapp-demo;
index index.php index.html index.htm;
location / {
try_files $uri $uri/ /index.php/$request_uri;
}
#error_page 404 /404.html;
# redirect server error pages to the static page /50x.html
#
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root /usr/share/nginx/html;
}
# pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
#
location ~ \.php$ {
fastcgi_pass unix:/var/run/php-fpm.sock;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
# deny access to .htaccess files, if Apache's document root
# concurs with nginx's one
#
#location ~ /\.ht {
# deny all;
#}
}