ngnix安装与配置

1.安装依赖

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

2.安装nginx

        解压   tar xvzf nginx-1.14.0.tar.gz app

                    ./configure ui

                    #此命令是指定nginx安装路径spa

                    ./configure --user=nginx --group=nginx --prefix=/app/nginx-1.14.0/ --with-http_v2_module --with-http_ssl_module --with-http_sub_module --with-http_stub_status_module --with-http_gzip_static_module --with-pcre3d

            make && make installblog

3.启动

    默认路径        ip

        cd /usr/local/nginx/sbin               ssl

            ./nginxopenssl

    指定配置文件域名

    /usr/local/nginx/sbin/nginx -c /app/nginx-1.14.0/conf/nginx.conf

 

4.经常使用命令  

nginx -s reload|reopen|stop|quit     #从新加载配置|重启|中止|退出 nginx

 

 

5.配置

修改nginx.conf文件

不一样域名,相同端口配置

同域名,根据域名后,项目名不一样,请求项目不一样

非80端口配置

相关文章
相关标签/搜索