为方便测试,单机部署多个 nginx,监听不同端口,响应不同页面。以其中一个为例:
/root/nginx/8571/ /root/nginx/8571/html/ /root/nginx/8571/log/
若 nginx.conf 配置 location 后,重启 nginx 再访问,如果访问提示:Nginx 403 Forbidden,则需要在 nginx.conf 头部加入一行:
user root;