检查是否安装nginx ps -ef|grep nginx
检查rpm是否安装nginx rpm -qa|grep nginx
查看linux centos 发行版本 cat /etc/centos-release (查看其它发现版本 就把centos替换为别的 比如 红旗的 redflag )
查看cpu信息 x86_64 lscpu
检查nginx所需依赖 rpm -ivh --test nginx-1.18.0-1.el7.ngx.x86_64.rpm
下载 以及安装地址
nginx RPM版本 此处版本是centos 7
Index of /packages/centos/7/x86_64/RPMS/
各种依赖下载地址 rpm 版本
centos-7-os-x86_64-Packages安装包下载_开源镜像站-阿里云
安装 各种依赖
openssl version 查看版本,可能需要升级
gcc 所需依赖
cpp-4.8.5-44.el7.x86_64.rpm
gcc-4.8.5-44.el7.x86_64.rpm
glibc-devel-2.17-317.el7.x86_64.rpm
glibc-headers-2.17-317.el7.x86_64.rpm
kernel-headers-3.10.0-1160.el7.x86_64.rpm
libmpc-1.0.1-3.el7.x86_64.rpm
mpfr-3.1.1-4.el7.x86_64.rpm
gcc 自己 与上面的分开两个文件夹
gcc-c+±4.8.5-44.el7.x86_64.rpm
libstdc+±4.8.5-44.el7.x86_64.rpm
libstdc+±devel-4.8.5-44.el7.x86_64.rpm
下完后放在一个文件夹 执行 rpm -Uvh *.rpm --nodeps --force
openssl 升级安装 查看版本 openssl version
所需依赖
keyutils-libs-devel-1.5.8-3.el7.x86_64.rpm
krb5-devel-1.15.1-50.el7.x86_64.rpm
krb5-libs-1.15.1-50.el7.x86_64.rpm
libcom_err-1.42.9-19.el7.x86_64.rpm
libcom_err-devel-1.42.9-19.el7.x86_64.rpm
libkadm5-1.15.1-50.el7.x86_64.rpm
libselinux-2.5-15.el7.x86_64.rpm
libselinux-devel-2.5-15.el7.x86_64.rpm
libsepol-devel-2.5-10.el7.x86_64.rpm
libverto-devel-0.2.5-4.el7.x86_64.rpm
openssl-1.0.2k-19.el7.x86_64.rpm
openssl-devel-1.0.2k-19.el7.x86_64.rpm
openssl-libs-1.0.2k-19.el7.x86_64.rpm
openssl-perl-1.0.2k-19.el7.x86_64.rpm
openssl-static-1.0.2k-19.el7.x86_64.rpm
pkgconfig-0.27.1-4.el7.x86_64.rpm
zlib-devel-1.2.7-18.el7.x86_64.rpm
如果是通过 rpm 包安装的,会自动创建 nginx.service 文件
查看自启动的命令 systemctl is-enabled nginx 加入自启动 systemctl enable nginx
代理转发配置关键 前端配置 prod-api
location /prod-api/ {
proxy_pass http://localhost:8098/;