Nginx无法打开mime.types。需要进行哪些更改?

时间:2013-04-23 18:11:30

标签: types nginx mime

我使用以下命令运行Nginx:

sudo /usr/local/Cellar/nginx/1.2.8/bin/nginx -c /usr/local/Cellar/nginx/1.2.8/nginx.conf

它发出错误:

nginx: [emerg] open() "/usr/local/Cellar/nginx/1.2.8/mime.types" failed (2: No such file or directory) in /usr/local/Cellar/nginx/1.2.8/nginx.conf:17

这需要什么才能发挥作用?

1 个答案:

答案 0 :(得分:2)

mime.types您没有/usr/local/Cellar/nginx/1.2.8/个文件。

/usr/local/Cellar/nginx/1.2.8/nginx.conf更改17行以引用正确的文件路径。

include /usr/local/Cellar/nginx/1.2.8/mime.types;

include /usr/local/Cellar/nginx/1.2.8/conf/mime.types;

mime.types文件通常位于conf/目录,如果没有,你可以使用`locate mime.types'命令找到它。