nginx - 在 NGINX 中使用 gzip_types/ssi_types 和 "wildcard"媒体类型

标签 nginx

我们有一个应用程序,为 json 提供媒体类型:application/vnd.example.v1.0+jsonapplication/vnd.example.v2.0+json等等。

如果我们想使用nginx的http://nginx.org/en/docs/http/ngx_http_ssi_module.html#ssi_typeshttp://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/

相关文章:

django - gzip - 关于性能的问题

nginx设置问题

python - Uwsgi/Nginx 给我——请求的修改器不可用 : 0 -- Error

nginx - 将自定义固定 header 传递给 nginx 中的 auth_request

使用 github 托管页面的 Facebook 应用

azure - 如何根据 NGINX 入口 Controller 中的源 IP 地址使用 if 条件路由流量

javascript - Nginx 反向代理到 Node.js 并重写

ssl - Nginx中的负载平衡-TCP,SSL,HTTPS

node.js - Ghost 博客与 Nginx 网关故障

node.js - 使用 nginx、socket.io 和 nodejs 在树莓派上托管 Angular 应用程序