1

Rewriting nginx's try_files

view story
linux-howto

http://serverfault.com – 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; } (HowTos)