Using gzip_types / ssi_types in NGINX with wildcard types

We have an application that serves the json with the type of media: application/vnd.example.v1.0+jsonand application/vnd.example.v2.0+jsonetc.

If we want to use nginx http://nginx.org/en/docs/http/ngx_http_ssi_module.html#ssi_types and http://nginx.org/en/docs/http/ngx_http_gzip_module.html#gzip_types . Do I need to add all possible version numbers or is there something like a template?

Instead:

gzip_types "application/vnd.example.v1.0+json" "application/vnd.example.v2.0+json" "application/vnd.example.v3.0+json"

- it's something like

gzip_types "application/vnd.example*+json"

perhaps?

+4
source share
1 answer

According to NGINX source code src/http/ngx_http.c:

if (value[i].len == 1 && value[i].data[0] == '*') {

No you can't

+2
source

Source: https://habr.com/ru/post/1621080/


All Articles