学习安装、配置nginx, 如果你有什么想学习的case或者想完成某些配置, 可在 issues 创建~
- linux服务器和一些常用的操作命令
- 域名,当然如果是本地玩玩也可以是
Hosts - 基本的正则表达式
修改配置文件后需要重启、刷新
nginx服务, 如:[sudo] nginx -s reload
- nginx配置文件说明 - done
- nginx配置目录建议 - done
- nginx状态码配置和错误文件 - done
- linux中编译安装和配置nginx - done
- 重新编译安装 - done
- 设置主域301重定向 - done
- 配置nodejs反向代理 - done
- 配置https - done
- nginx配置url重写 - done
- 配置图片防盗链 - done
- 配置CORS跨域 - done
- iconfont字体跨域配置 - done
- 安装nginx-http-concat - done
- 安装nginx-echo - done
- nginx日志切割-shell脚本 - done
- 配置默认主页、目录浏览 - done
- 配置浏览器缓存 - done
- 配置https资源代理 - ing
- 配置nginx前置缓存 - ing
- nginx负载均衡 - ing
- windows中安装nginx
表示该用户nginx不存在, 解决方法:
- 在
nginx.conf里添加user nobody; - 创建用户和用户对应的分组
表示用户分组不存在, 解决方法:
- 在
nginx.conf里添加user nobody; - 创建用户对应的分组
nginx: [alert] could not open error log file: open() "/logs/error.log" failed (13: Permission denied)
启动nginx的用户权限不够导致无法写入日志文件, 常见于非root用户启动报错
80端口被占用启动失败, 修改端口或者杀死占用者再启动即可
pid进程id文件不存在, 可能文件被删除或者已经停止, 在停止nginx时会使用该进程id, 如果不存在将失败, 可以手动kill掉
变量$realpath_roots_xxx不存在
add_header指令不能直接在if判断内, 可以在http、server、server.location、server.location.if下