修改端口号及根目录
vi /etc/nginx/conf.d/default.conf
server {
listen 8081 default_server;#端口号
# listen [::]:80 default_server;
server_name localhost;
# Load configuration files for the default server block.
include /etc/nginx/default.d/*.conf;
location / {
index index.html;
#root /usr/share/nginx/html;#原来的根目录
root /usr/local/sftp/mysftp;#修改后的
}
nginx 403 forbidden
原因是nginx修改根目录之后,根目录文件夹没有权限
执行命令
chmod -R 777 /usr/local/sftp/
参考网址:
安装nginx:https://www.digitalocean.com/community/tutorials/how-to-install-nginx-on-centos-6-with-yum
更改根目录:http://blog.csdn.net/u013075468/article/details/50544704
修改文件夹权限:http://www.centoscn.com/CentOS/Intermediate/2013/0805/1066.html