Complex url rewriting

lmauldinpe15 nginx-forum at
Mon Nov 23 17:48:32 UTC 2015

I have a single Nginx installation and I am using PHP-FPM to serve multiple
PHP applications in sub directories.  Example:

/var/www/  (this is 'root')

I want to setup url rewriting so that any request to
http://xxx/a/foo/index.php/users/login gets redirected to
http://xxx/a/foo/index.php and similarly
http://xxx/a/bar/index.php/users/login gets redirected to

I may have a large number of applications in the sub directories so I don't
want to setup individual location blocks for each application.  Can I
accomplish this with a global rewrite rule?  Please let me know if you need
more information.


Posted at Nginx Forum:,263024,263024#msg-263024

More information about the nginx mailing list