facebook twitter hatena line email

Linux/nginx/php-zend

提供: 初心者エンジニアの簡易メモ
2015年5月21日 (木) 05:39時点におけるAdmin (トーク | 投稿記録)による版

移動: 案内検索

php-fpmでzendを動かす時のサーバ設定

  • /etc/nginx/conf.d/sample1.localhost.conf
server {
   listen       80;
   server_name  sample1.localhost;
   root /var/www/zend/sample1/public;
   index  index.php index.html;
   location / {
       if (!-e $request_filename) {
           rewrite ^.*$ /index.php last;
       }
   }
   # location ~ .*\.(jpg|JPG|gif|GIF|png|PNG|swf|SWF|css|CSS|js|JS|inc|INC|ico|ICO) {
   location ~* \.(jpg|gif|png|swf|css|js|inc|ico) {
     root    /var/www/zend/sample1/public;
     index   index.html;
     ssi     on;
     break;
   }
   location ~ \.php$ {
     root /var/www/zend/sample1/public;
     fastcgi_pass   127.0.0.1:9000;
     fastcgi_index  index.php;
     fastcgi_param  SCRIPT_FILENAME  $document_root$fastcgi_script_name;
     include        fastcgi_params;
     fastcgi_param APPLICATION_ENV development;
   }

参照

http://koji27.cocolog-nifty.com/chat/2013/08/conoha-vps-cent.html