Fixing Nginx Reload Error Due to Unterminated Rewrite Directive

20 sec read

:: 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

How to fix problem with…

Facing a Git error with the 'vi' editor? Discover how to easily fix it by checking your Vim path and configuring Git to use...
Sysadmin.ID
10 sec read

Apache :: MP4 Streaming

Learn how to enable MP4 streaming in Apache with the installation of the mod_h264 streaming module, making your video content accessible and efficient. Follow...
Sysadmin.ID
18 sec read

Apache :: Flash / FLV…

Learn how to effortlessly configure Apache for FLV streaming by installing the mod_flvx module and updating your httpd.conf file. Discover the simple steps to...
Sysadmin.ID
15 sec read

3 Replies to “Fixing Nginx Reload Error Due…”

Leave a Reply

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