
 1. 自定义项目,需要在 conf.d 目录中增加一个 .conf 配置文件:
server {listen  9200;                      # 端口号server_name	localhost;             # 服务名称location / {root  /home/imx6q/media;        # 项目根目录(需要修改 nginx.conf 的用户)index index.html index.htm;     # autoindex on;                   # 没有找到 index 配置时,自动列出文件列表}
}
nginx 的默认根目录在 /var/www/html 目录中,默认用户为 www-data,无法访问 /var/www/html  之外的资源,因此需要修改 /etc/nginx/nginx.conf 中的 user ,让它能够访问其它路径。