我想在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的網站和他們工作正常。