码迷,mamicode.com
首页 > 其他好文 > 详细

Centos下编译安装nginx

时间:2018-11-14 12:27:32      阅读:185      评论:0      收藏:0      [点我收藏+]

标签:nbsp   依赖   dev   ati   query   files   下载安装   class   5.6   

1.安装依赖
yum install -y pcre-devel zlib-devel gcc openssl-devel gd-devel

2.下载安装包

不同版本的nginx下载地址:http://nginx.org/download
wget http://nginx.org/download/nginx-1.15.6.tar.gz
tar zxvf nginx-1.15.6.tar.gz
cd nginx-1.15.6
./configure --prefix=/opt/soft/nginx
make && make install
cd /opt/soft/nginx

3.基本配置nginx反代php-fpm配置

location / {
            root /opt/soft/project/public;
            try_files $uri $uri/ /index.php?$query_string;
        }

location ~ \.php$ {
        root /opt/soft/project/public;
        fastcgi_pass 127.0.0.1:9000;
        fastcgi_index index.php;
        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
        include fastcgi_params;
      }

 

Centos下编译安装nginx

标签:nbsp   依赖   dev   ati   query   files   下载安装   class   5.6   

原文地址:https://www.cnblogs.com/Kevin-1967/p/9957074.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!