记录 arm 开发板上 nginx 配置 http 服务注意事项

记录 arm 开发板上 nginx 配置 http 服务注意事项_第1张图片

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 ,让它能够访问其它路径。
记录 arm 开发板上 nginx 配置 http 服务注意事项_第2张图片

 

你可能感兴趣的:(nginx,http,运维)