• Our team is looking to connect with folks who use email services provided by Plesk, or a premium service. If you'd like to be part of the discovery process and share your experiences, we invite you to complete this short screening survey. If your responses match the persona we are looking for, you'll receive a link to schedule a call at your convenience. We look forward to hearing from you!
  • We are looking for U.S.-based freelancer or agency working with SEO or WordPress for a quick 30-min interviews to gather feedback on XOVI, a successful German SEO tool we’re looking to launch in the U.S.
    If you qualify and participate, you’ll receive a $30 Amazon gift card as a thank-you. Please apply here. Thanks for helping shape a better SEO product for agencies!
  • The BIND DNS server has already been deprecated and removed from Plesk for Windows.
    If a Plesk for Windows server is still using BIND, the upgrade to Plesk Obsidian 18.0.70 will be unavailable until the administrator switches the DNS server to Microsoft DNS. We strongly recommend transitioning to Microsoft DNS within the next 6 weeks, before the Plesk 18.0.70 release.
  • The Horde component is removed from Plesk Installer. We recommend switching to another webmail software supported in Plesk.

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