swoole负载均衡之nginx配置篇
一、nginx 安装
下载压缩包:wget -c https://nginx.org/download/nginx-1.10.3.tar.gz
解压:tar -xzvf nginx-1.10.3.tar.gz cd 进入目录
./configure --help 查看配置
--prefix :要安装的目录 --sbin-path :启动时要用到的目录 ——conf-path :nginx配置文件所放在的位置
--error-log-path :错误日志的路径
安装命令:./configure --prefix=/home/work/study/soft/nginx --sbin-path=/home/work/study/soft/nginx/sbin/nginx --conf-path=/home/work/study/soft/nginx/config/nginx.conf --error-log-path=/home/work/study/soft/nginx/logs/error.log --pid-path=/home/work/study/soft/nginx/logs/nginx.pid --http-log-path=/home/work/study/soft/nginx/logs/access.log
检测 make -j make install
然后修改nginx.conf配置文件 开启错误日志,开启日志,修改端口,设置静态文件访问路径等等配置。
nginx转发到swoole服务器之nginx配置文件配置
负载均衡