Welcome! Log In Create A New Profile

Advanced

Common Rewrite rules for subdirectories

Posted by syd05 
Common Rewrite rules for subdirectories
August 20, 2014 05:56AM
Hi,

I'm migrating from Apache to Nginx and I have a specific configuration that I need to replicate.

I have configured nginx to listen on a specific port and would have multiple subdirectories within for different users to do their developement. In Apache I would have .htaccess file in every subfolder where I would require rewrite rules. I need to do the same in nginx but would like to keep it common

e.g I can have two rewrite rules in respective location blocks for nginx like:

rewrite ^/user1/dir1/((?i)order-abc)$ /user1/dir1/verticals/index.php?url=abc;

rewrite ^/user2/dir2/((?i)order-abc)$ /user2/dir2/verticals/index.php?url=abc;

can i make it common by picking the user1/dir1 part from URL and doing some substitution

--Syd
Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 64
Record Number of Users: 6 on February 13, 2018
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready