I have been trying to get Nginx with CakePHP running with no success with regards the rewrite. I have read tons of articles and can't see anything wrong with my config file.
Nginx Webroot: /usr/share/nginx/html
CakePHP Installation: /usr/share/nginx/html/cakephp
Error: URL rewriting is not properly configured on your server.
- Help me configure it
- I don't / can't use URL rewriting
Config file:
server {
listen 80;
root /usr/share/nginx/html;
index index.php index.html index.htm;
server_name localhost;
location / {
try_files $uri $uri/ /index.html;
}
location /doc/ {
alias /usr/share/doc/;
autoindex on;
allow 127.0.0.1;
allow ::1;
deny all;
}
error_page 404 /404.html;
error_page 500 502 503 504 /50x.html;
location ~ \.php$ {
try_files $uri =404;
fastcgi_pass unix:/var/run/php5-fpm.sock;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
# Deny access to .htaccess files,
location ~ /(\.ht|\.git|\.svn) {
deny all;
}
}

所有评论(0)