Posted on April 29, 2018 at 6:55 pm
If you get this erro message when restarting Nginx:
Restarting nginx: [emerg]: directive "rewrite" is not terminated by ";" |
Make sure to read the docs for http://wiki.nginx.org/HttpRewriteModule#rewrite
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 ^/([a-z]{2})(\/$|$) /index.php?lang=$1 last; |
Should be:
rewrite "^/([a-z]{2})(\/$|$)" /index.php?lang=$1 last; |
Note the “” characters.
Other Posts
- Block Paltalk Ads (and Others) via Hosts file
- E: Sub-process /usr/bin/dpkg returned an error code (2)
- How to Validate JSON in PHP
- The program can’t start because VCRUNTIME140.DLL is missing
- PHP CURL Download Remote URL to File
- PHP Check if a file was modified more than 1 hour ago
- Linux -bash: Input/output error or -bash: Read-only file system
- Dropzone.js: Drag’n’Drop File Uploads with Image Previews
Updated Posts
- Lost connection during Debian apt-get upgrade
- Bootstrap 3 Navbar with Logo Image
- Redis HMGET, HGETALL, HSET, HGET Benchmark
- PHP GetHostByName() Slow? Make it Faster
- Use Timestamp with new DateTime() in PHP
- Calculate Elapsed Time Between Two Dates in PHP
- PHP Display Date Same as Server HTTP Headers Date
- PHP cURL Download Size Limit