When using named capture, if PCRE library is old, Nginx config won’t support lines like below:


Rather than getting $blogpath in named capture, you will get error like:

nginx: [emerg] pcre_compile() failed: unrecognized character after (?< in "^(?/[_0-9a-zA-Z-]+/)files/(.*)” at “blogpath>/[_0-9a-zA-Z-]+/)files/(.*)” in /etc/nginx/conf.d/my.conf:2


Replace ? with ?P
So above line should be rewritten as:


You can notice there is a P between ? and <