Is there a length limitation on file extensions?

A. Schulze sca at andreasschulze.de
Mon Mar 7 22:33:53 UTC 2016


j.o.l:

> I am using Nginx to serve a website that hosts a .Net application. The file
> a user needs to download and that triggers installation is a *.application
> file, and an MS Internet Information Server associates that with the mime
> type application/x-ms-application. However that file never gets any
> Content-Type header. I edited the mime.types configuration file to include
> that, but Nginx ignores that. When I rename the file to .app, and use a mime
> type definition for that file it works. I also tried various other file
> extensions of varying length, and it looks like there is a limit of 10
> characters in a file type extenion of Nginx, and if that is exceeded there
> will be no Content-Type header.
> Is my assumption correct? Where is this in the source files? (I know how to
> compile Nginx). Or any other idea what causes my problem?
> Thanks, Joachim

works here, so your assumption seems wrong.

server {
     listen                      *:80;
     server_name                 localhost;
     location / {
       autoindex                 on;
       alias                     /tmp/;
     }
     types {
       application/x-ms-executable application;
     }
}

$ touch /tmp/foo.application

$ curl -I localhost/foo.application
HTTP/1.1 200 OK
Server: nginx
Date: Mon, 07 Mar 2016 22:29:42 GMT
Content-Type: application/x-ms-executable
Content-Length: 0
Last-Modified: Mon, 07 Mar 2016 22:26:52 GMT
Connection: keep-alive
Accept-Ranges: bytes

$




More information about the nginx mailing list