我们有一个应用程序,为 json 提供媒体类型:application/vnd.example.v1.0+json
和 application/vnd.example.v2.0+json
等等。
如果我们想使用nginx的http://nginx.org/en/docs/http/ngx_http_ssi_module.html#ssi_types和 http://nginx.org/en/docs/http/ngx_http_gzip_module.html#gzip_types .我们是否必须附加每个可能的版本号或者是否有通配符之类的东西?
代替:
gzip_types "application/vnd.example.v1.0+json" "application/vnd.example.v2.0+json" "application/vnd.example.v3.0+json"
就像
gzip_types "application/vnd.example*+json"
可能的?
最佳答案
根据NGINX源代码src/http/ngx_http.c
:
if (value[i].len == 1 && value[i].data[0] == '*') {
不,你不能
关于nginx - 在 NGINX 中使用 gzip_types/ssi_types 和 "wildcard"媒体类型,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34392175/