Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update 1.7.x nginx template ; part 2 #1190

Merged
merged 4 commits into from Oct 15, 2021
Merged

Update 1.7.x nginx template ; part 2 #1190

merged 4 commits into from Oct 15, 2021

Commits on Oct 8, 2021

  1. Simplify back office rewrite rule.

    Simplify back office `rewrite` rule.
    
    `rewrite` takes a regex to match against the URI, but since we don’t
    care about what the URI is we just use a `^` which means “beginning of
    string” and thus matches everything.
    juangiordana committed Oct 8, 2021
    Configuration menu
    Copy the full SHA
    4a51384 View commit details
    Browse the repository at this point in the history
  2. Simplify installation sandbox rewrite rule.

    Simplify installation sandbox `rewrite` rule by removing the second
    capture group, since it's not being used.
    juangiordana committed Oct 8, 2021
    Configuration menu
    Copy the full SHA
    c8e399e View commit details
    Browse the repository at this point in the history

Commits on Oct 14, 2021

  1. Improve product images rewrite rules.

    Improve product images `rewrite` rules.
    
    Consider the following example for easier reading:
    
    ```regexp
    ^/([0-9])([0-9])(-[_a-zA-Z0-9-]*)?(-[0-9]+)?/.+.jpg$ /img/p/$1/$2/$1$2$3$4.jpg last;
                           ^/(\d)(\d)(-[\w-]+)?/.+\.jpg$ /img/p/$1/$2/$1$2$3.jpg last;
    ```
    
    * Replace `[0-9]` with `\d`.
    * Replace `[_a-zA-Z0-9-]` with `[\w-]`.
    * Remove the last capture group `(-[0-9]+)?` as it is already matched
    in the previous capture group.
    * Properly escape the dot character (`\.`) used in the file
    extension: `\.jpg`.
    juangiordana committed Oct 14, 2021
    Configuration menu
    Copy the full SHA
    64784f6 View commit details
    Browse the repository at this point in the history
  2. Improve category images rewrite rules.

    Improve category images `rewrite` rules.
    
    * Unlike product images, we only need to capture what is in the second
    level of the URI, so there is no need to have multiple regular
    expressions to achieve this task.
    
    Taking into account previous rules, the list of allowed characters is
    set to include any alphanumeric characters `\w`, the dot `.`, and the
    hyphen `-`, simplifying the whole capture group to: `([\w.-]+)`
    
    * Properly escape the dot character (`\.`) used in the file
    extension: `\.jpg`.
    juangiordana committed Oct 14, 2021
    Configuration menu
    Copy the full SHA
    e72b80a View commit details
    Browse the repository at this point in the history