安装:

yum install epel-release

SRE实战 互联网时代守护先锋,助力企业售后服务体系运筹帷幄!一键直达领取阿里云限量特价优惠。

yum install nginx

配置:

/etc/nginx/nginx.conf

server {
    listen        80;//监听端口号
    server_name   example.com *.example.com;
    location / {
            proxy_pass         http://localhost:5000;//转发到
            proxy_http_version 1.1;
            proxy_set_header   Upgrade $http_upgrade;
            proxy_set_header   Connection keep-alive;
            proxy_set_header   Host $http_host;
            proxy_cache_bypass $http_upgrade;
    }
}

启动服务:

systemctl start nginx

 

或者源码安装:

http://www.nginx.org/

 

编译安装:

yum -y install gcc zlib zlib-devel pcre-devel openssl openssl-devel

./configure

make

make install

 

配置文件:

/usr/local/nginx/conf/nginx.conf

 

启动:

/usr/local/nginx/sbin/nginx

扫码关注我们
微信号:SRE实战
拒绝背锅 运筹帷幄