nginx访问静态资源 打开nginx配置文件 1 打开 nginx.conf 文件 2 修改 nginx.conf 内容 只需修改成或者添加一个location,就可以访问 html路径下所有文件了 location / { alias /www/server/nginx/html/; autoindex on; } 如果只需要访问html特定文件夹内容,需要指定 location /static/{ alias /www/server/nginx/html/static/ } 效果