2016年3月23日 星期三

nginx call php and node.js by route forward



sudo apt-get install php5-fpm sudo vim /etc/php5/fpm/php.ini
cgi.fix_pathinfo=0
safe_mode = Off
restart php fpm
sudo service php5-fpm restart
generate php file path
mkdir /usr/share/nginx/www
vim $CKFINDER/config.php
修改檔案位置,以及網址設定
$baseUrl = 'http://domain.com/path/';
$baseDir = '/PATH/FOLDER/IMAGES';
i have no idea, why there is images floder more.
but, it works
chmod 777 $FOLDER_PATH

edit nginx

server {
  listen 80;
  root /usr/share/nginx/www;
  location ~ \.php$ {
    try_files $uri =404;
    fastcgi_pass unix:/var/run/php5-fpm.sock;
    fastcgi_index index.php;
    fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
    include fastcgi_params;
  }
  
  location / {
    proxy_set_header X-Real-IP $remote_addr;
    proxy_pass http://127.0.0.1:1337;
    proxy_set_header X-Forwarded-For $remote_addr;
    proxy_http_version 1.1;
    proxy_set_header Upgrade $http_upgrade;
    proxy_set_header Connection "upgrade";
    proxy_set_header Host $host;
  }

}


沒有留言:

張貼留言

Facebook