将htaccess规则转换为nginx

我想知道是否有人可以告诉我以下htaccess代码的nginx规则是什么。 我在网上search,但我没有find任何东西。

<FilesMatch "\.(ttf|otf|eot)$"> <IfModule mod_headers.c> Header set Access-Control-Allow-Origin "*" </IfModule> </FilesMatch> 

它看起来像这样:

 server { listen 80; server_name nginx.org www.nginx.org; root /data/www; location / { index index.html index.php; } location ~* \.(ttf|otf|eot)$ { add_header Access-Control-Allow-Origin "*"; } } 

我只是从记忆中写下来,所以你必须testing它。 location ~*表示正则expression式不区分大小写的匹配。 server中的所有其他confs都是信息性的。 就这样,你可以琢磨这些如何一起工作。

更多信息: