My docker image has suddenly failed after build with error message:
2021/12/30 16:02:26 [emerg] 16#16: pcre2_compile() failed: unrecognized character follows \ in "\index.htm(l?)" at "index.htm(l?)" in /etc/nginx/conf.d/default.conf:37
We are building docker image from nginx:latest, which is currently 1.21.5.
I've degraded to nginx 1.21.4 and it starts without an issue.
My problematic configuration is:
location ~* \index.htm(l?) {
add_header Cache-Control 'no-cache, no-store, must-revalidate';
}
Was there any breaking change indroduced between nginx 1.12.4 and 1.12.5, or I was using a deprecated syntax? I've never got any warning about it.