Я использую nginx в качестве сервера rtmp, используя этот модуль rtmp https://github.com/arut/nginx-rtmp-module, и я пытаюсь перейти на страницу статистики, но при попытке просмотреть статистику на http://ip:8080/stat/stat.xsl я получаю пустую страницу с следующее в консоли на Chrome:
Resource interpreted as Stylesheet but transferred with MIME type text/xml: "http://ip:8080/stat/stat.xsl".
и эта ошибка в Firefox Error loading stylesheet: Parsing an XSLT stylesheet failed.
Я пытался и пытался, но не смог решить эту проблему. Это соответствующая часть nginx.conf:
http {
include /usr/local/nginx/conf/mime.types;
#default_type application/octet-stream;
server {
listen 8080;
location /hls {
types {
application/vnd.apple.mpegurl m3u8;
}
alias /HLS/hls;
add_header Cache-Control no-cache;
}
location /stat {
types {
application/xml dae;
}
rtmp_stat all;
rtmp_stat_stylesheet stat.xsl;
}
location /stat.xsl {
types {
application/xml dae;
}
root /usr/local/nginx/html/stat.xsl/;
}
}
}
Вот как выглядит соответствующая часть файла mimes.types для nginx:
types {
text/html html htm shtml;
text/css css;
text/xml xml;
image/gif gif;
image/jpeg jpeg jpg;
application/javascript js;
application/atom+xml atom;
application/rss+xml rss;
text/mathml mml;
text/plain txt;
text/vnd.sun.j2me.app-descriptor jad;
text/vnd.wap.wml wml;
text/x-component htc;
image/png png;
image/svg+xml svg svgz;
image/tiff tif tiff;
image/vnd.wap.wbmp wbmp;
image/webp webp;
image/x-icon ico;
image/x-jng jng;
image/x-ms-bmp bmp;
font/woff woff;
font/woff2 woff2;
application/xml xsl;
Я уверен, что это проблема с типами MIME, как в консоли Chrome, я могу щелкнуть файл и увидеть содержимое stats.xsl в консоли, но он просто не отображается на странице.
Есть идеи, что я могу делать не так?
Спасибо.