💎一站式轻松地调用各大LLM模型接口,支持GPT4、智谱、星火、月之暗面及文生图 广告
## install Install the EPEL repository: ~~~ sudo yum install epel-release ~~~ Update the repository: ~~~ sudo yum update ~~~ ~~~ sudo yum install nginx ~~~ Verify the installation: ~~~ sudo nginx -v ~~~ 自行编译 #### 安装依赖 ~~~ yum install openssl-devel pcre-devel pcre gcc zlib -y ~~~ * pcre 正则处理需要 * gcc 编译需要 * zlib 压缩需要 * openssl 安全链接需要 下载nginx源 ~~~ $ wget https://nginx.org/download/nginx-1.16.1.tar.gz $ tar zxf nginx-1.16.1.tar.gz $ cd nginx-1.16.1 ~~~ 查看编译帮助信息 ~~~ $ ./configure --help ~~~ 使用--with添加模块,使用--without排除模块。 ~~~ $ ./configure --sbin-path=/usr/local/nginx/nginx --conf-path=/usr/local/nginx/nginx.conf --pid-path=/usr/local/nginx/nginx.pid --with-pcre=../pcre-8.43 --with-zlib=../zlib-1.2.11 --with-http_ssl_module --with-stream --with-mail=dynamic --add-module=/usr/build/nginx-rtmp-module --add-dynamic-module=/usr/build/3party_module ~~~ ~~~ $ make;make install ~~~ The main purpose of the master process is to read and evaluate configuration, and maintain worker processes.Worker processes do actual processing of requests. nginx employs event-based model and OS-dependent mechanisms to efficiently distribute requests among worker processes. The number of worker processes is defined in the configuration file and may be fixed for a given configuration or automatically adjusted to the number of available CPU cores. To start nginx, run the executable file. Once nginx is started, it can be controlled by invoking the executable with the`-s`parameter. Use the following syntax. 主进程的主要意图是读取配置以及维护从进程,实际从进程执行请求工作,nginx采用事件驱动以及系统环境无关机制在从进程中高效的分发请求,从进程的个数由配置文件定义,或者调整以及自动适应cpu的个数。 ~~~ nginx -s signal ~~~ * `stop` — fast shutdown * `quit` — graceful shutdown * `reload` — reloading the configuration file * `reopen` — reopening the log files ~~~ nginx -s quit ~~~ This command should be executed under the same user that started nginx. Changes made in the configuration file will not be applied until the command to reload configuration is sent to nginx or it is restarted. To reload configuration, execute: ~~~ nginx -s reload ~~~ ### Basic Functionlity 通常配置文件在/usr/local/nginx/conf, 出于方便考虑,建议将各类配置文件都放置在/etc/nginx/conf.d文件下并且使用include指令包括在nginx.conf文件里面。 少数几个top\_level的指令,被应用于不同的网路。 * `events`– General connection processing * `http`– HTTP traffic * `mail`– Mail traffic * `stream`– TCP and UDP traffic Directives placed outside of these contexts are said to be in the*main*context. 在这些指令之外的内容是主内容。