🔥码云GVP开源项目 12k star Uniapp+ElementUI 功能强大 支持多语言、二开方便! 广告
1. 安装依赖 ~~~ centos: yum -y install zlib zlib-devel openssl openssl-devel pcre pcre-devel openssl openssl-devel gcc Ubuntu: apt-get install build-essential libtool ~~~ ~~~ wget http://nginx.org/download/nginx-1.10.1.tar.gz tar -zxvf nginx-1.10.1.tar.gz cd nginx-1.10.1 ./configure \ --prefix=/usr \ --sbin-path=/usr/sbin/nginx \ --conf-path=/etc/nginx/nginx.conf \ --error-log-path=/var/log/nginx/error.log \ --http-log-path=/var/log/nginx/access.log \ --pid-path=/var/run/nginx/nginx.pid \ --lock-path=/var/lock/nginx.lock \ --user=root \ --group=root \ --with-http_ssl_module \ --with-http_flv_module \ --with-http_stub_status_module \ --with-http_gzip_static_module \ --with-pcre make && make install ~~~ 2. 启动 `/usr/sbin/nginx` ~~~ nginx -s reload :修改配置后重新加载生效 nginx -s reopen :重新打开日志文件 nginx -t -c /path/to/nginx.conf 测试nginx配置文件是否正确 ~~~ 3. 关闭nginx: ~~~ nginx -s stop :快速停止nginx quit :完整有序的停止nginx ~~~