CakePhp&;Nginx子页面未显示
我最近在端口8085的nginx上托管了cakephp应用程序 我重新启动nginx,索引页加载正常。 但每当我点击同一个网站(另一个页面)的某个链接时,网页上什么也没有打印出来 请告诉我我的nginx设置有什么问题 这是我的nginx配置CakePhp&;Nginx子页面未显示,php,cakephp,nginx,Php,Cakephp,Nginx,我最近在端口8085的nginx上托管了cakephp应用程序 我重新启动nginx,索引页加载正常。 但每当我点击同一个网站(另一个页面)的某个链接时,网页上什么也没有打印出来 请告诉我我的nginx设置有什么问题 这是我的nginx配置 server { server_name example.com; root /var/www/html/cakephp/app/webroot; access_log /var/log/nginx/cakeapp.acce
server {
server_name example.com;
root /var/www/html/cakephp/app/webroot;
access_log /var/log/nginx/cakeapp.access.log;
error_log /var/log/nginx/cakeapp.error.log;
listen 8085;
rewrite_log on;
# rewrite rules for cakephp
location / {
index index.php index.html;
# If the file exists as a static file serve it
# directly without running all
# the other rewite tests on it
if (-f $request_filename) {
break;
}
if (!-f $request_filename) {
rewrite ^/(.+)$ /index.php?url=$1 last;
break;
}
}
location ~* \favicon.ico$ {
expires 6m;
}
location ~ ^/img/ {
expires 7d;
}
location ~ \.php$ {
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
# include /etc/nginx/fastcgi_params;
include /etc/nginx/fastcgi.conf;
fastcgi_param SERVER_NAME $host;
}
location ~ /\.ht {
deny all;
}
}
对于cake php,它的路由有点不同,试试这个
root DIR/app/webroot/;
location / {
index index.php index.html;
rewrite ^/$ /index.php?url=/;
if (!-e $request_filename) {
rewrite ^(/.*)$ /index.php?url=$1 last;
}
}
我不会尝试这段代码,但你可以