:: Error when reload / restart nginx

nginx -s reload
nginx: [emerg] directive "rewrite" is not terminated by ";" /etc/nginx/vhost/blackonsole.org.conf:15

in line 15 use { and } characters in the regular expressions conflict with the block delimiter of the Nginx configuration file syntax language, some like:

rewrite ^/([0-9A-Za-z]{12})(/.+|.html?|$)       /cgi-bin/index.cgi last;

If you want to write a regular expression pattern that includes curly brackets, you need to place the pattern between quotes (single or double quotes)

rewrite "^/([0-9A-Za-z]{12})(/.+|.html?|$)"       /cgi-bin/index.cgi last;

 
:: Links
+ Google
+ Ivorde

Hi, I’m Sysadmin.ID

3 Comments

Leave a Reply

Your email address will not be published. Required fields are marked *