Skip to content

Instantly share code, notes, and snippets.

@masudianpour
Created February 14, 2014 11:29
Show Gist options
  • Save masudianpour/8999590 to your computer and use it in GitHub Desktop.
Save masudianpour/8999590 to your computer and use it in GitHub Desktop.

Revisions

  1. masudianpour created this gist Feb 14, 2014.
    34 changes: 34 additions & 0 deletions Laravel & NginX
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,34 @@
    server{

    listen 90;

    server_name masud.dev;

    access_log /var/log/nginx/access.log;
    error_log /var/log/nginx/error.log;
    rewrite_log on;

    root /var/nginx/www/PROJECT/public/;

    index index.php;

    location / {
    try_files $uri $uri/ /index.php?$query_string;
    }

    if (!-d $request_filename){
    rewrite ^/(.+)/$ /$1 permanent;
    }

    location ~* \.php$ {
    fastcgi_pass unix:/var/run/php5-fpm.sock;
    fastcgi_index index.php;
    fastcgi_split_path_info ^(.+\.php)(.*)$;
    fastcgi_param SCRIPT_FILE_NAME $document_root$fastcgi_script_name;
    include /etc/nginx/fastcgi_params;
    }

    location ~ /\.ht {
    deny all;
    }
    }