Curly braces ({ and }) from Apache to Nginx rewrite rules. Curly braces ({ and }) from Apache to Nginx rewrite rules. apache apache

Curly braces ({ and }) from Apache to Nginx rewrite rules.


Read this documentation. especially:

Note: for curly braces( { and } ), as they are used both in regexes and for block control, to avoid conflicts, regexes with curly braces are to be enclosed with double quotes (or single quotes).

So for example the line :

rewrite ^/saison-([0-9]{1})$ /pages.php?cat_page=saison-$1&season=$1 last;

should be:

rewrite "^/saison-([0-9]{1})$" /pages.php?cat_page=saison-$1&season=$1 last;

This should remove the ";" syntax error (for the rule I didn't check they are functionnaly valid).