---
title: 配置Nginx
description: "1. 修改mod_fastdfs.conf文件。"
url: https://www.hikunpeng.com/document/detail/zh/kunpengsdss/ecosystemEnable/FastDFS/openmind_kunpengfastdfs_04_0008.html
sourcePath: /source/zh/kunpengsdss/ecosystemEnable/FastDFS/openmind_kunpengfastdfs_04_0008.html
indexId: 81328169614f2a274ca9b12fb2f0703e3dc4e7617894c8ad9c6e1ee14f2312ae83
---
# 配置Nginx

1. 修改mod_fastdfs.conf文件。
  1 vim /etc/fdfs/mod_fastdfs.conf

  修改第40行、第53行和第62行内容，需要修改内容如下。

  1 2 3 tracker_server=210.26.55.190:22122 #tracker服务器IP和端口 url_have_group_name=true store_path0=/home/dfs/storage

2. 修改nginx.config文件。
  1 vim /usr/local/nginx/conf/nginx.conf

  添加如下配置。

  1 2 3 4 5 6 7 8 9 10 11 server { listen 80; # 该端口为storage.conf中的http.server_port相同 server_name 210.26.55.190; location ~/group[0-9]/ { ngx_fastdfs_module; } error_page 500 502 503 504 /50x.html; location = /50x.html { root html; } }

3. 启动Nginx。

```
/usr/local/nginx/sbin/nginx
```
