# springboot-nginx **Repository Path**: javacse/springboot-nginx ## Basic Information - **Project Name**: springboot-nginx - **Description**: 使用Nginx 搭建文件服务器 - **Primary Language**: Java - **License**: MulanPSL-2.0 - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 1 - **Forks**: 0 - **Created**: 2021-11-03 - **Last Updated**: 2023-07-15 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # SpringBoot + Nginx 文件上传 --- ## Nginx 文件配置 > Mac 用户需要在`nginx.conf`文件第一行添加此配置 `user root owner`; ```text server { listen 1005; # nginx服务地址 server_name localhost; location / { root html; index index.html index.htm; } #以下为我添加的配置 location ~ .(jpg|png|jpeg|gif|bmp|pdf|xls|doc|docx|zip|rar|txt)$ { #可识别的文件后缀 root /Users/guanhuimin/Desktop/work/file/; #图片的映射路径 autoindex on; #开启自动索引 } } ``` ## 接口返回示例 ![](src/main/resources/static/img.png)