Shawn
Shawn

Reputation: 34239

braces and nginx rewrite rule

How do I use braces in nginx rewrite rules, e.g.

rewrite ^(.*)\.[0-9]{8,}\.(js|css|png|jpg|gif|bmp) $1.$2 last;

running

nginx -t

gives an error, saying the rewrite rule is not terminated by ';', how can I fix this?

Thanks.

Upvotes: 1

Views: 1412

Answers (1)

Shawn
Shawn

Reputation: 34239

looks quoting the regex works

 rewrite "^(.*)\.[0-9]{8,}\.(js|css|png|jpg|gif|bmp)" $1.$2 last;

Upvotes: 2

Related Questions