我使用以下命令运行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
这需要什么才能发挥作用?
答案 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'命令找到它。