环境配置:

nginx/1.14.0
PHP 7.2.8 (cli) 
Debian 3.16.43-2+deb8u5
192.168.1.124

nginx和php安装

参考:lnmp一键安装

获取可道云

root@centos-mysql01:# wget  http://static.kodcloud.com/update/download/kodexplorer4.37.zip
root@centos-mysql01:/usr/local/nginx/html# unzip kodexplorer4.37.zip
    root@centos-mysql01:/usr/local/nginx/html# chmod -R 777 ../html/

配置nginx

server {
listen 80;
server_name _;
access_log /data/wwwlogs/access_nginx.log combined;
root /usr/local/nginx/html;
index index.html index.htm index.php;
#error_page 404 /404.html;
#error_page 502 /502.html;
location /nginx_status {
  stub_status on;
  access_log off;
  allow 127.0.0.1;
  deny all;
}
location ~ [^/]\.php(/|$) {
  #fastcgi_pass remote_php_ip:9000;
  fastcgi_pass unix:/dev/shm/php-cgi.sock;
  fastcgi_index index.php;
  include fastcgi.conf;
}
location ~ .*\.(gif|jpg|jpeg|png|bmp|swf|flv|mp4|ico)$ {
  expires 30d;
  access_log off;
}
location ~ .*\.(js|css)?$ {
  expires 7d;
  access_log off;
}
location ~ /\.ht {
  deny all;
}
}
 include vhost/*.conf;
}

启动访问测试

root@centos-mysql01:/usr/local/nginx/html# nginx  -t
   nginx: the configuration file /usr/local/nginx/conf/nginx.conf syntax is ok
   nginx: configuration file /usr/local/nginx/conf/nginx.conf test is successful
root@centos-mysql01:/usr/local/nginx/html# nginx  -s reload 

访问:192.168.1.124

转载至:https://blog.51cto.com/14037805/2334461