Questions tagged [mime-type]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
19 votes
3 answers
61k views

How can I make sure that Nginx serves plaintext files as a download, instead of inline?

I have Rails application (Redmine) which works with Nginx. If I am clicking on any attachment my browser (firefox, ie, chrome) ask me to download file. But if I am clicking on txt-type attachment my ...
ceth's user avatar
  • 546
11 votes
3 answers
6k views

nginx, x-accel-redirect and mime types

In my nginx 0.8.34 setup I'm using the X-Accel-Redirect feature to control file downloads in the application code while not having the application handle the download itself. After much pain this now ...
Tomas Kohl's user avatar
9 votes
1 answer
26k views

nginx how to override/add single mime-type

I tried to add markdown rendering by putting types { text/markdown md; } into server section, but then index.html stopped to be rendered all of a sudden. I can explain this only if types overrides ...
anatoly techtonik's user avatar
9 votes
2 answers
5k views

Can I alias all directory requests to a single file in nginx?

I'm trying to figure out how to take all requests made to a particular directory and return a json string without a redirect, in nginx. Example: curl -i http://example.com/api/call1/ Expected ...
user749618's user avatar
7 votes
3 answers
11k views

How can I define a mime type in nginx for tar.bz2 or tar.gz files?

I tried adding these lines to mime.types: application/x-gtar tar.gz tgz tar.bz2 tbz2 tbz; application/x-bzip2 bz2; application/x-gzip gz; But nginx reports "Content-Type: application/x-bzip2" for a ...
aditsu's user avatar
  • 386
6 votes
1 answer
2k views

Apache treating files with ".var[.]" in their names as type-maps

So today at work I ran into a strange problem. An application I was writing had a JavaScript file named form.sales.var.js, placed in the same directory as other JS files. However, when the browser ...
Lèse majesté's user avatar
5 votes
1 answer
3k views

Insert MIME type of an URL into Apache's access_log

I would like to enhance my logfile with an additional field containing the mime type. E.G. 127.0.0.1 - - [01/Mar/2012:20:49:36 +0100] "GET / HTTP/1.1" 200 255 [...] "text/html" 127.0.0.1 - - [01/Mar/...
mawimawi's user avatar
  • 400
5 votes
1 answer
7k views

What MIME type should I put for Windows shortcut file (.URL)

If I want to have a Windows shortcut file (foo.URL) to be saved for the users, what MIME type should I assign for it? Default text/plain causes Windows to suggest it to be saved with .txt added as ...
Touko's user avatar
  • 241
4 votes
2 answers
5k views

Change type of all .xml file in a SVN repository

How can I change the type of all the files in a repository SVN who have the extension .xml from the type binary to the type text. It means, is no more necessary to change the type of each file, one ...
taintedlove's user avatar
4 votes
2 answers
2k views

How to set different mod_mime rules for reverse proxy?

By default, httpd contains the following configuration: <IfModule mime_module> # # TypesConfig points to the file containing the list of mappings from # filename extension to MIME-...
Gili's user avatar
  • 295
4 votes
2 answers
13k views

What is AddType application/x-httpd-php-source

I have Apache 2.0, PHP 5.2.4, and this directive in the httpd.conf: AddType application/x-httpd-php-source .php .php3 .php4 .php5 .php6 AddType directive is used to maps the given filename ...
egor's user avatar
  • 41
3 votes
1 answer
8k views

Nginx: serving files as text without having .txt appended to it

I have some .rb (Ruby script) files that I link to on my website. By default, the browser just downloads them to the "Downloads" folder, as it does zip files. I want the browser to treat it as text, ...
lwood's user avatar
  • 65
3 votes
2 answers
34k views

How to make NGINX server JSON files with the type application/json instead of text/plain?

My server is serving my "manifest.json" file as text/plain which means the browser can't read it. There is definitely a line for it in /etc/nginx/config/mime.types application/json ...
stackers's user avatar
  • 327
3 votes
3 answers
3k views

How to serve giziped text files with nginx

To save space we gzip all our logs and text files and these files are browsed by the user, but these files are downloaded instead of opened in the browser, I couldn't find a way to set mime-type text/...
Anurag Uniyal's user avatar
3 votes
1 answer
4k views

Adding a new IIS Mime Type without doing an IIS Reset?

I have to add a new mime type to an IIS 6.0 web server. The client would like this done ASAP as it currently isn't serving .flv files. However, the server is used for other clients and I would like ...
Robin Day's user avatar
  • 506
3 votes
2 answers
10k views

Mime type received as "text/html", server configured to send as "text/javascript"

Both firefox and chrome are showing that javascript files from my server are served as MIME type text/html. The javascript files have a .js extension. First, mime_module is installed and active: ...
a coder's user avatar
  • 799
3 votes
1 answer
3k views

Nginx not adding expires headers to fonts, not changing mime types

I have the following location block in my server block in /etc/sites-available/example.com: location ~* \.(ttf|woff|woff2|eot|mp4|css|gif|ico|jpeg|jpg|js|png)$ { expires max; ...
geochanto's user avatar
  • 159
3 votes
1 answer
1k views

css files are reported as text/plain by mimetype on ubuntu machine

When I run the following command mimetype -DM --database /usr/share/misc/magic /path/to/reset.css I expect to see text/css as a result but instead I get text/plain. Is there a way to fix this? ...
Optimus's user avatar
  • 169
3 votes
1 answer
4k views

Limit file upload per type with NGinx

In my project, I will allow users to send zip files and images files (on two different form post). The project is developed with Play! Framework (not PHP). I'd like to limit the size of upload for 1MB ...
Cyril N.'s user avatar
  • 626
3 votes
3 answers
9k views

Apache reverse proxy AH01597: could not open mime types config file

I'm trying to configure Apache HTTP server 2.4 as a reverse proxy on RHEL 7 server. When Apache starts up it complains in its log file (/var/log/httpd/error_log): AH01597: could not open mime types ...
Raedwald's user avatar
  • 201
2 votes
1 answer
2k views

IIS How to allow a single file as browsable

I'm using IIS 7.5 and my goal to allow this one json file as browsable however I don't want any other json files to be accessible when navigating through the URL, therefore the typical IIS 404 page ...
MPaul's user avatar
  • 141
2 votes
2 answers
798 views

Lotus Domino HTTP: Define MIME types

My Lotus Domino 9.0 server serves the application cache manifest as application/octet-stream, where the browser expects text/cache-manifest. I only found examples how to add a MIME type to Apache and ...
Alexander's user avatar
  • 137
2 votes
1 answer
870 views

Have files with querystring included in their name. Need nginx to ignore querystring for the content header

Have a directory with lots of files. These are all static files from backups. The issue is that some files that are named like the following: mystyle.css?version=3.3.1 When serving the files, nginx ...
Mamsaac's user avatar
  • 123
2 votes
1 answer
4k views

IIS ignoring mime-type settings and serving file as application/octet-stream

We added both handlers and mime-types for IIS in the web.config to tell the server how to handle the different types of audio and video files we are using on the site. IIS does not seem to be ...
LocalPCGuy's user avatar
2 votes
2 answers
3k views

Mime types get removed by iisreset

I am trying to deploy a Silverlight app to iis on a Win 2003 server. I add the mime type for silverlight to iis ( .xap, application/x-silverlight-app ) and then restart the app pool, and the app ...
Roger Guess's user avatar
1 vote
1 answer
4k views

Ngingx returns 404 on local .ttf font

I have a local .ttf font which I need to use. I have tried to edit mime-types application/x-font-truetype ttfl also tried application/x-font-ttf ttf; And mysite.conf looks like this: server { ...
artouiros's user avatar
  • 121
1 vote
2 answers
3k views

Nginx: How to serve different urls with different settings from one file?

I have thousands of text files named like ABC. I'd like to access those files from different URL: - if it is ABC or ABC.txt I'd like to add default_type text/plain and serve that file - if it is ABC....
jcisio's user avatar
  • 586
1 vote
2 answers
3k views

Cannot load IMG without specifying extension

I just moved to a new server. All my site is including images without extensions. () but the new server doesn't seem to recognize this files unless I add each file's extension which I don't know so I ...
Lisandro Vaccaro's user avatar
1 vote
1 answer
3k views

video/mp4 vs video/mpeg mime type

I need to add some .mp4 videos to a course in my LMS (Moodle) on a Windows 2008 R2 server. I'm using IIS 7.5 as the web server. While searching the www for the correct way to do it I've found several ...
luisdev's user avatar
  • 143
1 vote
1 answer
1k views

Apache returning incorrect mime type for meta-data.xml.md5

I'm struggling to get apache2 to serve a file with the correct mime type. I'm using an installation of apache 2.2 installed with apt-get on Ubuntu. The file in question is a maven repository file ...
Philip Couling's user avatar
1 vote
1 answer
1k views

Using mime_header_checks to ACCEPT instead of REJECT?

I'm pretty well versed in using header_checks/mime_header_checks to refuse smtp mail in Postfix, but now I think I've gone off the path of righteousness; I'm trying to suss out a way that I can refuse ...
GeminiDomino's user avatar
1 vote
1 answer
192 views

Remove unrecognised staticContent mimeMap entries

On a default installation of IIS there are approximately 350 <mimeMap /> elements specified in the <staticContent> section. Some file extensions seem alien to me e.g. .sv4cpio, .cpio, ....
Kevin Brydon's user avatar
1 vote
2 answers
4k views

IIS: Request with unknown content-type denied

I have an IIS7.5 box running an asp.net mvc 3 application. The application receives binary POST requests and returns a binary answer. To distinguish this binary data from all other packets I setup my ...
m__'s user avatar
  • 563
1 vote
0 answers
191 views

Response with and in memory file with Django and nginx

I have a piece of code that works fine on my local setup (Django embeded dev server running on Windows) but not on server (ubuntu + gunicorn + nginx) I build an Excel file et send it from memory like ...
Yvain's user avatar
  • 121
1 vote
0 answers
456 views

change mime type for one user agent

I'm trying to overwrite the mime type of a file for a specific User Agent only (Chrome) and leave the default for the others (Firefox). Options +Indexes IndexOptions -FancyIndexing Header set Access-...
koma5's user avatar
  • 11
1 vote
1 answer
2k views

Mime Magic on files without extension on Apache/2.2.31 and mod_wsgi 3.4

Sorry in advance for the length, thanks for your patience. I have an ancient production server that no one knows how it was built. It uses apache+mod_wsgi to run a Cherry Py python application to ...
Chris Robak's user avatar
1 vote
1 answer
4k views

Set content-type header for jsonp in htaccess

I'm having trouble with a 3rd-party javascript game that is installed on my site, where the content-type response header being returned is application/json rather than application/javascript for a ...
nkanderson's user avatar
1 vote
0 answers
1k views

MIME/Content type changed after change in server

This is my first question so I apologize if I my post has any mistakes. I've searched about this issue for close to two days now and I still only am a bit closer than I was before.Here is my problem. ...
Prasanth's user avatar
1 vote
0 answers
421 views

CentOS - Files to Copy to get Consistent MIME-type detection in PHP

I have the same website (written in PHP) running on two servers. I've tried uploading the same exact file to both servers through the website. On one of the servers, the file's mimetype is detected as ...
kai's user avatar
  • 11
1 vote
0 answers
238 views

IIS virtual folder mime types

Consider following scenario. I have physical folder with mp3 files. I want these files to be served with application/octet-stream mime when accessed via http://example.com/dl/foo.mp3 and with audio/...
Vasaka's user avatar
  • 111
1 vote
0 answers
391 views

How to specify proper mime for javascript in apache?

I'm trying to set up mod_mime for javascript. My webserver returns this content-type for js files: Content-Type:application/x-javascript; charset=utf-8 so obviously the directive ExpiresByType ...
zerkms's user avatar
  • 461
1 vote
1 answer
2k views

Web server serves up PDF file as wrong mime type

Following an upgrade to the latest version of Joomla, downloads from a website I am working on are being served incorrectly. Example page: http://www.pacificpolicy.org/index.php?option=com_content&...
user avatar
0 votes
2 answers
900 views

Create Exception on Mime filtering on squid

I have a server with the operating system Ubuntu 12:04 LTS version. I also paired the squid version 3.1.19 on my server. with the client about 30 units. to prevent my clients to download any files ...
Heri YT's user avatar
  • 51
0 votes
2 answers
3k views

Wrong mime-type for css and js files

I am new to Apache. I have almost no knowledge of apache. I am using apache 2.2.11. I have one css file and multiple .js files which i am uploading to a remote storage with a php page(PHP - 5.2.8). ...
Ruchit Rami's user avatar
0 votes
2 answers
2k views

Apache is sending php files to my browser instead of parsing

I have to set up PHP on an existing web host. I have made a virtual host entry, but for some reason Apache is sending the PHP to the browser instead of parsing.. from googling around it looks like it'...
user avatar
0 votes
1 answer
2k views

IIS returning 404 on PDF File

I have a IIS 10.0 server that everything is working fine, with one issue. Any .pdf file returns 404. I know permissions are correct as all the image files in the same folder are working fine. The ...
alexander7567's user avatar
0 votes
1 answer
430 views

GIF loses mime type with Apache rewrite

Got problem with a gif that loses it's animation with the rewrites I'm doing. RewriteRule ^journal/(.+)\.(jpeg|jpg|png|mp4|webm|ogv)$ app/uploads/journal/$1 [QSA,L] RewriteRule ^journal/(.+)\.(gif)$ ...
INT's user avatar
  • 121
0 votes
1 answer
3k views

How to correct the MIME type from being recognized as text/x-asm to text/css?

The styles.css file is not loading on my web page, and I am hosting on Amazon S3. It appears that my styles.css file is being recognized as text/x-asm instead of text/css as stated in my index.html ...
modulitos's user avatar
  • 335
0 votes
2 answers
567 views

How does lighttpd/nginx determine filetype of a file? (which method?)

I want to configure my lighttpd to serve some static files, with compression capability. The files are plain text but they have .bin extension. I have these lines in my lighttpd configuration: ...
Reza Mohammadi's user avatar
0 votes
1 answer
4k views

NGINX MIME TYPE

I have my nginx conf file so that when ever a mobile device visits my site the url gets rewritten to m.mysite.com I did it by adding the following set $mobile_rewrite do_not_perform; if ($...
justanotherprogrammer's user avatar