---
title: "nginx 简单配置"
author: "stephen80"
date: "2013-10-29T15:49:29Z"
tags: []
categories: ["Web前端"]
slug: "nginx"
draft: false
lastmod: "2013-10-29T15:49:29Z"
id: 1966123
url: "https://stephen80.iteye.com/blog/1966123"
---

如何用nginx 发表一个文件 ？

1.修改nginx.conf
  增加：

 66     server {
     67         listen       80;
     68         server_name  iece.jd.com;
     69 
     70         location / {
     71             root   /home/ece/htdocs/ftp.ece;
     72             index  index.html index.htm;
     73         }
     74     }



2.检查配置
 sudo ./nginx -t -c conf/nginx.conf 

3.reload

./nginx -s reload

4.试验
wget iece.jd.com

5. 解决权限问题
403 forbidden

nginx/logs/error.log 
      failed (13: Permission denied 

修改配置  nginx.conf  : user root;

(namei -l /home/ece/htdocs/ftp.ece/index.html )