Query Rewrite Help

Ben ben+nginx at list-subs.com
Mon Jul 13 10:17:16 UTC 2015


Hi,

Am suffering with a bit of writer's block when it comes to query rewrites.

I've got a rewrite rule that looks like :

rewrite ^/api/app/([^/]+)/([^/]+)/([^/]+)?$ /api/app/$1.php?p=$2&q=$3? last;

I am having two problems :

- I am getting 404 when I try to make a POST call to /api/app/login,  I 
have to use the full suffix, i.e. api/app/login.php instead.

- I want to make the last ([^/]+) optional, but seem to also be getting 
the same 404 if I forget to include it ?

Ideas most welcome, thanks !



More information about the nginx mailing list