nginx配置前端路径
时间: 2023-09-04 22:07:52 浏览: 132
在nginx中配置前端路径可以通过修改nginx的配置文件来实现。根据引用中的示例配置,可以在`location /`的`root`对应的值中设置前端项目的根目录路径。比如,如果前端项目的根目录路径为`/home/project/shoping`,则可以将配置文件中的`root`的值修改为该路径。例如:
```
location / {
root /home/project/shoping;
...
}
```
这样配置后,访问nginx服务器的根路径时,会自动匹配到该前端项目的根目录路径。<span class="em">1</span><span class="em">2</span><span class="em">3</span>
#### 引用[.reference_title]
- *1* *2* [用nginx部署前端项目](https://blog.csdn.net/qq_33036061/article/details/115046354)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_1"}}] [.reference_item style="max-width: 50%"]
- *3* [vue-router+nginx 非根路径配置方法](https://download.csdn.net/download/weixin_38666300/14816004)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_1"}}] [.reference_item style="max-width: 50%"]
[ .reference_list ]
阅读全文