I have problems to use mime directive


In my use case I try to provide an emberjs application.
For this use case caddy should be able to do this, it is a HTML5 / CSS / JS static website.
Normal HTML5 / CSS / JS works fine but I have some static json files which are used for test data.
The json files are delivered with contentType text/html. I know this is the default behaivior.
I tried to solve this problem using the mime directive.

I use caddy 0.9.2 64Bit windows version ==> I use Windows 10

THe content of my Caddy file looks like:

*:2020 {
root ./dist
mime .json application/json

After starting caddy with this Caddyfile content I get an error:

Activating privacy features…2016/09/23 08:56:39 [mime] failed to get certificate: acme: Error 400 - urn:acme:error:malformed - DNS name does not have enough labels

I don’t want use https currently.

I tried the same using linux and got the same error.

I use the the Caddyfile without the mime directive with OSX and the json files were delivered with application/json contentType per default.

What is wrong here ?

Best regards


Your directives have to appear within a site block:

:2020 {
    root ./dist
    mime .json application/json

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.