Welcome! Log In Create A New Profile

Advanced

Nginx location block and performance

Posted by seoerinuk 
Nginx location block and performance
February 13, 2016 04:22AM
I am not an expert with Nginx, so I read several articles and the official guideline to get myself up to speed. However, I found nothing that touch base on the location vs rewrite block performance.

My scenario is the following: an existing website changed their english URLs into Chinese, and I have to prevent any loss of traffic for several URLs (about 1m)

I came up with two working configuration, though this was limited to just a few URLs and I wasn't able to test on any production or pre-production environment to validate the effectiveness.

Solution A)

Use n+1 rewrite blocks followed by a permanent flag straight in the server block;

Solution B)

Use n+1 exact location blocks with a nested rewrite and permanent flag followed by a break;

Both solutions have a catch all rule that redirect to an index.php file to allow Magento process the request and produce the output.

My understanding is that solution B may be more efficient thanks to the break instruction that will prevent additional rewriting rule to be executed, forwarding the rewrite module straight to the location blocks. As I have only one of them - a catch all - there is very little choice here.

Given the above, is it correct assuming the solution B is more efficient?
Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 324
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready