blog/content/post/2011/05/14/2011-05-14-00001491.md

138 lines
9.7 KiB
Markdown
Raw Normal View History

2019-03-31 11:00:21 +00:00
---
title: nginxのmimeタイプの設定
author: kazu634
date: 2011-05-14
wordtwit_post_info:
- 'O:8:"stdClass":13:{s:6:"manual";b:0;s:11:"tweet_times";i:1;s:5:"delay";i:0;s:7:"enabled";i:1;s:10:"separation";s:2:"60";s:7:"version";s:3:"3.7";s:14:"tweet_template";b:0;s:6:"status";i:2;s:6:"result";a:0:{}s:13:"tweet_counter";i:2;s:13:"tweet_log_ids";a:1:{i:0;i:5427;}s:9:"hash_tags";a:0:{}s:8:"accounts";a:1:{i:0;s:7:"kazu634";}}'
categories:
- ubuntu
---
<div class="section">
<p>
Apacheからnginxに移行したタイミングで RSS ファイルを識別できなくなっていました。原因を調べてみたら、nginx だと rdf ファイルの mime タイプの指定がされていないことが原因でした。
</p>
<p>
結果としては以下のように /etc/nginx/mime.type に追記して、 nginx をリロードしてあげれば、期待した動作をしてくれました:
</p>
<pre class="syntax-highlight">
kazu634@www3232u% cat mime.types
types <span class="synSpecial">{</span>
text/html html htm shtml<span class="synStatement">;</span>
text/css css<span class="synStatement">;</span>
text/xml xml rss<span class="synStatement">;</span>
image/gif gif<span class="synStatement">;</span>
image/jpeg jpeg jpg<span class="synStatement">;</span>
application/x-javascript js<span class="synStatement">;</span>
application/atom+xml atom<span class="synStatement">;</span>
text/mathml mml<span class="synStatement">;</span>
text/plain txt<span class="synStatement">;</span>
text/vnd.sun.j2me.app-descriptor jad<span class="synStatement">;</span>
text/vnd.wap.wml wml<span class="synStatement">;</span>
text/x-component htc<span class="synStatement">;</span>
image/png png<span class="synStatement">;</span>
image/tiff tif tiff<span class="synStatement">;</span>
image/vnd.wap.wbmp wbmp<span class="synStatement">;</span>
image/x-icon ico<span class="synStatement">;</span>
image/x-jng jng<span class="synStatement">;</span>
image/x-ms-bmp bmp<span class="synStatement">;</span>
image/svg+xml svg svgz<span class="synStatement">;</span>
application/java-archive jar war ear<span class="synStatement">;</span>
application/mac-binhex40 hqx<span class="synStatement">;</span>
application/msword doc<span class="synStatement">;</span>
application/pdf pdf<span class="synStatement">;</span>
application/postscript ps eps ai<span class="synStatement">;</span>
application/rtf rtf<span class="synStatement">;</span>
application/vnd.ms-excel xls<span class="synStatement">;</span>
application/vnd.ms-powerpoint ppt<span class="synStatement">;</span>
application/vnd.wap.wmlc wmlc<span class="synStatement">;</span>
application/vnd.google-earth.kml+xml kml<span class="synStatement">;</span>
application/vnd.google-earth.kmz kmz<span class="synStatement">;</span>
application/x-7z-compressed 7z<span class="synStatement">;</span>
application/x-cocoa cco<span class="synStatement">;</span>
application/x-java-archive-diff jardiff<span class="synStatement">;</span>
application/x-java-jnlp-file jnlp<span class="synStatement">;</span>
application/x-makeself run<span class="synStatement">;</span>
application/x-perl pl pm<span class="synStatement">;</span>
application/x-pilot prc pdb<span class="synStatement">;</span>
application/x-rar-compressed rar<span class="synStatement">;</span>
application/x-redhat-package-manager <span class="synStatement">rpm;</span>
application/x-sea sea<span class="synStatement">;</span>
application/x-shockwave-flash swf<span class="synStatement">;</span>
application/x-stuffit sit<span class="synStatement">;</span>
application/x-tcl tcl tk<span class="synStatement">;</span>
application/x-x509-ca-cert der pem crt<span class="synStatement">;</span>
application/x-xpinstall xpi<span class="synStatement">;</span>
application/xhtml+xml xhtml<span class="synStatement">;</span>
application/zip zip<span class="synStatement">;</span>
application/octet-stream bin exe dll<span class="synStatement">;</span>
application/octet-stream deb<span class="synStatement">;</span>
application/octet-stream dmg<span class="synStatement">;</span>
application/octet-stream eot<span class="synStatement">;</span>
application/octet-stream iso img<span class="synStatement">;</span>
application/octet-stream msi msp msm<span class="synStatement">;</span>
application/ogg ogx<span class="synStatement">;</span>
audio/midi mid midi kar<span class="synStatement">;</span>
audio/mpeg mpga mpega mp2 mp3 m4a<span class="synStatement">;</span>
audio/ogg oga ogg spx<span class="synStatement">;</span>
audio/x-realaudio ra<span class="synStatement">;</span>
audio/webm weba<span class="synStatement">;</span>
video/3gpp 3gpp 3gp<span class="synStatement">;</span>
video/mp4 mp4<span class="synStatement">;</span>
video/mpeg mpeg mpg mpe<span class="synStatement">;</span>
video/ogg ogv<span class="synStatement">;</span>
video/quicktime mov<span class="synStatement">;</span>
video/webm webm<span class="synStatement">;</span>
video/x-flv flv<span class="synStatement">;</span>
video/x-mng mng<span class="synStatement">;</span>
video/x-ms-asf asx asf<span class="synStatement">;</span>
video/x-ms-wmv wmv<span class="synStatement">;</span>
video/x-msvideo avi<span class="synStatement">;</span>
application/xml rdf<span class="synStatement">;</span>
<span class="synSpecial">}</span>
kazu634@www3232u% diff mime.types.orig mime.types
77a78,<span class="synConstant">79</span>
<span class="synStatement">&#62;</span>
<span class="synStatement">&#62;</span> application/xml rdf<span class="synStatement">;</span>
kazu634@www3232u% sudo service nginx <span class="synStatement">reload</span>
<span class="synStatement">[</span>sudo<span class="synStatement">]</span> password <span class="synStatement">for</span> kazu634:
Reloading nginx configuration: nginx.
</pre>
<div class="hatena-asin-detail">
<a href="http://www.amazon.co.jp/dp/4048702270/?tag=hatena_st1-22&ascsubtag=d-7ibv" onclick="__gaTracker('send', 'event', 'outbound-article', 'http://www.amazon.co.jp/dp/4048702270/?tag=hatena_st1-22&ascsubtag=d-7ibv', '');"><img src="https://images-na.ssl-images-amazon.com/images/I/51xpswg%2BkkL._SL160_.jpg" class="hatena-asin-detail-image" alt="ハイパフォーマンスHTTPサーバ Nginx入門" title="ハイパフォーマンスHTTPサーバ Nginx入門" /></a></p>
<div class="hatena-asin-detail-info">
<p class="hatena-asin-detail-title">
<a href="http://www.amazon.co.jp/dp/4048702270/?tag=hatena_st1-22&ascsubtag=d-7ibv" onclick="__gaTracker('send', 'event', 'outbound-article', 'http://www.amazon.co.jp/dp/4048702270/?tag=hatena_st1-22&ascsubtag=d-7ibv', 'ハイパフォーマンスHTTPサーバ Nginx入門');">ハイパフォーマンスHTTPサーバ Nginx入門</a>
</p>
<ul>
<li>
<span class="hatena-asin-detail-label">作者:</span> <a href="http://d.hatena.ne.jp/keyword/Clement%20Nedelcu" onclick="__gaTracker('send', 'event', 'outbound-article', 'http://d.hatena.ne.jp/keyword/Clement%20Nedelcu', 'Clement Nedelcu');" class="keyword">Clement Nedelcu</a>,<a href="http://d.hatena.ne.jp/keyword/%C4%B9%C8%F8%B9%E2%B9%B0" onclick="__gaTracker('send', 'event', 'outbound-article', 'http://d.hatena.ne.jp/keyword/%C4%B9%C8%F8%B9%E2%B9%B0', '長尾高弘');" class="keyword">長尾高弘</a>
</li>
<li>
<span class="hatena-asin-detail-label">出版社/メーカー:</span> <a href="http://d.hatena.ne.jp/keyword/%A5%A2%A5%B9%A5%AD%A1%BC%A1%A6%A5%E1%A5%C7%A5%A3%A5%A2%A5%EF%A1%BC%A5%AF%A5%B9" onclick="__gaTracker('send', 'event', 'outbound-article', 'http://d.hatena.ne.jp/keyword/%A5%A2%A5%B9%A5%AD%A1%BC%A1%A6%A5%E1%A5%C7%A5%A3%A5%A2%A5%EF%A1%BC%A5%AF%A5%B9', 'アスキー・メディアワークス');" class="keyword">アスキー・メディアワークス</a>
</li>
<li>
<span class="hatena-asin-detail-label">発売日:</span> 2011/04/21
</li>
<li>
<span class="hatena-asin-detail-label">メディア:</span> 大型本
</li>
<li>
<span class="hatena-asin-detail-label">購入</span>: 2人 <span class="hatena-asin-detail-label">クリック</span>: 714回
</li>
<li>
<a href="http://d.hatena.ne.jp/asin/4048702270" onclick="__gaTracker('send', 'event', 'outbound-article', 'http://d.hatena.ne.jp/asin/4048702270', 'この商品を含むブログ (23件) を見る');" target="_blank">この商品を含むブログ (23件) を見る</a>
</li>
</ul>
</div>
<div class="hatena-asin-detail-foot">
</div>
</div>
</div>