• We value your experience with Plesk during 2024
    Plesk strives to perform even better in 2025. To help us improve further, please answer a few questions about your experience with Plesk Obsidian 2024.
    Please take this short survey:

    https://pt-research.typeform.com/to/AmZvSXkx
  • The Horde webmail has been deprecated. Its complete removal is scheduled for April 2025. For details and recommended actions, see the Feature and Deprecation Plan.
  • We’re working on enhancing the Monitoring feature in Plesk, and we could really use your expertise! If you’re open to sharing your experiences with server and website monitoring or providing feedback, we’d love to have a one-hour online meeting with you.

Question Mime Type for Nginx

fliegerhermi

Regular Pleskian
Hi everyone.
A client wants to offer dxf files for download.
The file is always opened in the browser as text file.

I tried to add the mime types to the common apache settings mime-type section as described here: Apache and Nginx Settings

I put the following entry:
application/acad .dwg
application/dxf .dxf

It didn't help. The files are still opened in the browser. Are the directives also valid for nginx?

Thank you for your help
 
Hi Igor,
thank you for the quick reply.

The filetype in questions is dxf (not dfx) and dxf is included in the list.
Any other idea?
 
I tried to reproduce your problem but I couldn't. I took a plain Plesk server, default installation. I added a domain and created a file "test.dxf" and called the URL. Result: Browser wants to download the file.

Here are the headers of the HTTP response:
Code:
# curl -v -s http://my-test-domain.tld/test.dxf 1>/dev/null
> GET /test.dxf HTTP/1.1
> User-Agent: curl/7.29.0
> Host: my-test-domain.tld
> Accept: */*
>
< HTTP/1.1 200 OK
< Server: nginx
< Date: Thu, 22 Jul 2021 07:34:09 GMT
< Content-Type: image/vnd.dxf
< Content-Length: 5
< Connection: keep-alive
< X-Accel-Version: 0.01
[...]

So default content-type is "image/vnd.dxf".

Next, I added the following to "Apache & nginx settings" at "Mime types" => "Custom value":
Code:
application/dxf .dxf

Result: The content-type has changed and the browser still wants to download the file:
Code:
# curl -v -s http://my-test-domain.tld/test.dxf 1>/dev/null
> GET /test.dxf HTTP/1.1
> User-Agent: curl/7.29.0
> Host: my-test-domain.tld
> Accept: */*
>
< HTTP/1.1 200 OK
< Server: nginx
< Date: Thu, 22 Jul 2021 07:34:13 GMT
< Content-Type: application/dxf
< Content-Length: 5
< Connection: keep-alive
< X-Accel-Version: 0.01
[...]

Do you have any other custom settings? Maybe there is an .htaccess file that overrides some settings?
 
Back
Top