> But it seems that this rule is not working, could you please help? Regular expression locations are matched in the order they are defined in the nginx config file, so you need to put that location above . http://wiki.nginx.org/HttpCoreModule#location rr