windows下配置nginx访问本地静态资源,完整配置,使用root和alias的区别,小心掉坑里 |
您所在的位置:网站首页 › nginx反向代理绝对路径 › windows下配置nginx访问本地静态资源,完整配置,使用root和alias的区别,小心掉坑里 |
需求
我有几个html,css,js文件,需要本地启动nginx访问,以前觉得很简单,但是踩了一些坑之后,做个记录 http://localhost:8765/vision-push/ 使用root的配置的说明原始文件在D:\jar\vision-push2/debug-all.html下 访问地址:http://localhost:8765/vision-push2 nginx拼接地址:D:\jar\vision-push,会把vision-push带上 location /vision-push { root D:\jar; index debug-all.html index.html; } 使用alias配置说明原始文件在D:\jar\vision-push2/debug-all.html下 访问地址:http://localhost:8765/vision-push nginx拼接地址:D:\jar\vision-push,会把vision-push带上 location /vision-push { alias D:\jar\vision-push; index debug-all.html index.html; } root和alias完整对比 location /vision-push { root D:\jar; index debug-all.html index.html; } location /vision-push { alias D:\jar\vision-push; index debug-all.html index.html; }
|
今日新闻 |
推荐新闻 |
CopyRight 2018-2019 办公设备维修网 版权所有 豫ICP备15022753号-3 |