WishMeLz

生活其实很有趣

Centos安装Nginx

# 依赖
yum -y install gcc zlib zlib-devel pcre-devel openssl openssl-devel
# 下载安装包
wget http://nginx.org/download/nginx-1.13.7.tar.gz
# 解压
tar -xvf  
# 进入运行文件
./configure
# 运行编译
make
# 安装
make install

nginx  reload 重启
service nginx restart 
nginx -t 验证配置文件

# 一份模板,不完整
worker_processes  1;

events {
    worker_connections  1024;
}
http {
    include       mime.types;
    default_type  application/octet-stream;
    sendfile        on;
    keepalive_timeout  65;

    server {
        listen       80;
        server_name _;
        root   /html;
        index  index.html index.htm index.php;
}
    include extra/*.conf;
}