如何用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 )
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 )