Skip to content

Instantly share code, notes, and snippets.

@xianhuazhou
Created April 1, 2014 10:57
Show Gist options
  • Save xianhuazhou/9911834 to your computer and use it in GitHub Desktop.
Save xianhuazhou/9911834 to your computer and use it in GitHub Desktop.
server {
listen 80;
server_name laravel;
root /var/www/laravel/public;
error_log /usr/local/nginx/logs/laravel.error.log;
access_log /usr/local/nginx/logs/laravel.access.log;
location / {
index index.php;
try_files $uri $uri/ @laravelapp;
}
location @laravelapp {
rewrite ^ /index.php last;
}
# pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
location ~ \.php(/|$) {
fastcgi_pass 127.0.0.1:9000;
fastcgi_split_path_info ^(.+\.php)(/.*)$;
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment