Nginx location regex not matching Nginx location regex not matching nginx nginx

Nginx location regex not matching


Your first match group is file name without extension, while you're passing it to the last fallback URL where extension is expected.

Also there's no point of escaping forward slashes. They have no special meaning here.

server {    listen 80;    server_name localhost;    root  /var/www/localhost/www;    location ~* ^/sys/assets/(.+)\.css$ {      try_files $uri /sys/assets/stylesheets/$1.css;    }}