我想在Linux服务器CentOS 7操作系统上安装CakePHP 3。我已经使用composer创建了一个项目,并且正确安装了正确的权限。在我的虚拟主机文件我已经根据official documentCakePHP 3 NGINX URL重写问题
server {
listen 80;
server_name remote.inodd.com;
## redirect http to https ##
rewrite 301 https://$server_name$request_uri permanent;
#rewrite 301 https://$server_name$request_uri permanent;
}
server {
# listen 80;
listen 443 ssl;
server_name remote.inodd.com;
ssl_certificate /home/vhost/www/domain/ssl/self-ssl.crt;
ssl_certificate_key /home/vhost/www/domain/ssl/self-ssl.key;
# note that these lines are originally from the "location /" block
root /home/vhost/www/domain/public_html;
index index.php;
access_log /home/vhost/www/domain/logs/access_log;
error_log /home/vhost/www/domain/logs/error_log;
location/{
#try_files $uri $uri/ =404;
try_files $uri $uri/ /index.php?url=$request_uri;
}
error_page 404 /404.html;
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root /usr/share/nginx/html;
}
location ~ \.php$ {
try_files $uri =404;
fastcgi_pass unix:/var/run/php-fpm/php-fpm.sock;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
}
配置的配置文件,所以当我浏览网址https://remote.inodd.com/development/,我得到的CakePHP显示配置的状态默认着陆页。一切都检查出正常的数据库连接。但是我得到下面的警告,即重写配置不正确。
您的服务器上未正确配置URL重写。
1)帮我配置它
2)我不知道/不能使用URL重写
不知道还有什么我缺少这里我能够设置非CakePHP的网站和他们工作正常。