I've spent ages looking on google for any information, and asked around some people (before anyone suggests I go and do so).
The bits of my nginx.conf that aren't working properly are below. What's working : rewrite to BlogHome, Home and About.
What isn't working - rewrites to C_ReadBlogURL and C_ReadAllPosts . These both 404 for some reason, even though the paths are correct. I don't understand why - and I've been puzzling over this all day. I think it may have something to do with them being php files, but I've no idea.
Any help would be greatly appreciated :)
server {
listen 80;
server_name blog.example.com;
root /usr/share/nginx/www/example;
index /views/Read/BlogHome.php;
location / {
rewrite ^/?$ /views/Read/BlogHome.php last; break;
rewrite ^/(.+)/?$ /controllers/read/C_ReadBlogURL.php?url=$1 last; break;
}
location ~ \.php$ {
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_pass unix:/var/run/php5-fpm.sock;
fastcgi_index index.php;
include fastcgi_params;
}
}
server {
listen 80;
server_name example.com;
root /usr/share/nginx/www/example;
index /controllers/read/C_ReadLatestPost.php;
location ~ ^(/posts\.php) {
rewrite ^(/posts\.php) /controllers/read/C_ReadAllPosts.php?type=$arg_type last; break;
}
location ~ ^/?$ {
rewrite ^/?$ /controllers/read/C_ReadLatestPost.php last; break;
}
location ~ ^(/about)/?$ {
rewrite ^(/about)/?$ /views/Read/About.php last; break;
}
location ~ \.php$ {
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_pass unix:/var/run/php5-fpm.sock;
fastcgi_index index.php;
include fastcgi_params;
}
}