I am trying to convert a very simple rewrite from a previous nginx version to the current one looking like below:
location / {
if ( !-f $request_filename ) {
rewrite ^/([a-z]*)$ /index.php?action=$1;
rewrite ^/([a-z]*)/(.*)$ /index.php?action=$1&item=$2;
}
}
This is how far I have gotten. The index page shows up, but any page that should be rewritten like above, instead throws 404's:
server {
listen 80 default;
root /var/www;
index index.php;
server_name _;
location / {
try_files $uri $uri/ /index.php?action=$uri&item=$args;
}
location ~ \.php$ {
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
include fastcgi_params;
}
}
What am I doing wrong here?