php-fpm laravel

From WebHostingNeeds.com
Jump to: navigation, search

php-fpm nginx configuration for laravel web site. This will work with other framework like Zend, CodeIgniter, Yii, CakePHP, etc..

server {

    listen       192.168.1.150:80;

    server_name webhostingneeds.com;
    root /home/webhostingneeds.com/public;
    index index.html index.php;

    location / {
        try_files $uri $uri/ /index.php$is_args$args;
    }

    location ~ \.(js|css|png|jpg|gif|swf|ico|pdf|mov|fla|zip|rar)$ {
       try_files $uri =404;
       access_log off;
       expires max;
    }

    location = /robots.txt      { access_log off; log_not_found off; }
    location = /favicon.ico    { access_log off; log_not_found off; }  

    location ~ \.php$ {
        include /etc/nginx/fastcgi_params;
        fastcgi_index   index.php;
        #fastcgi_pass   127.0.0.1:9000;
        fastcgi_pass  unix:/var/run/php-fpm.sock;
        fastcgi_param  SCRIPT_FILENAME $document_root$fastcgi_script_name;
    }

}



php fpm

nginx