Copyright ©

Mongoose OS Forum

ATTENTION! This forum has moved to:

Do not post any new messages.

Custom MIME types

Could someone give an example of setting custom MIME types in Mongoose 6.5.

I guess it has something to do with the custom_mime_types option of the mg_serve_http_opts object. But I am unsure of the syntax. I need to set the Content-Encoding to serve .gz files with "Content-Encoding: gzip".


  • As with the other post, I'm now getting around this by using alternative mg_serve_http_opts structure.

  • SergeySergey Dublin, Ireland

    Ok, just to clarify, the syntax is:

    struct mg_serve_http_opts opts;
    memset(&opts, 0, sizeof(opts));
    opts.custom_mime_types = ".gz=gzip";
Sign In or Register to comment.