-1

How can i set white list extension for special directory for my virtual host. I have bower installation of my webapp and i install many bower component into bower_components directiry of root of virtual host

/vhostroot
  /bower_components
  /foo
  /bar
  index.php

how can i set nginx white list extension on bower_components directory for example css,js,woff and etc...

my config doesn't work

  location /bower_components {
          if ($request_filename !~* \.(css|js|woff)$ ) {
                  return 403;
                  break;
          }
  }

1 Answers1

0

I found the way but it's good or not please offer me best way

  location ~ /bower_components {
          if ($request_filename !~* \.(css|js|woff)$ ) {
                  return 403;
                  break;
          }
  }