我使用以下来运行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
什么是需要这个工作?
您在/usr/local/Cellar/nginx/1.2.8/
没有mime.types
文件。
在/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'命令找到它。