[root@Nginx ~]# yum -y install pcre-devel zlib-devel popt-devel openssl-devel openssl

yum -y install gcc
[root@Nginx ~]# wget http://www.nginx.org/download/nginx-1.21.0.tar.gz
[root@Nginx ~]# ls
anaconda-ks.cfg  nginx-1.21.0.tar.gz
[root@Nginx ~]# tar zxf nginx-1.21.0.tar.gz -C /usr/src/
[root@Nginx ~]# cd /usr/src/nginx-1.21.0/
[root@Nginx nginx-1.21.0]# useradd -M -s /sbin/nologin nginx
[root@Nginx nginx-1.21.0]# ./configure \
--prefix=/usr/local/nginx \
--user=nginx \
--group=nginx \
--with-file-aio \
--with-http_stub_status_module \
--with-http_gzip_static_module \
--with-http_flv_module \
--with-http_ssl_module \
--with-stream \
--with-pcre && make && make install
[root@Nginx nginx-1.21.0]# ln -s /usr/local/nginx/sbin/nginx /usr/local/sbin/
[root@Nginx nginx-1.21.0]# cd
[root@Nginx ~]# nginx
[root@Nginx ~]# netstat -anpt | grep 80





stream {

upstream backend {

server chat.openai.com:443;

}

server {

listen 80;

proxy_connect_timeout 1s;

proxy_timeout 3s;

proxy_pass backend;

}

}

  • 无标签