Skip to content

Instantly share code, notes, and snippets.

@tiancheng91
Last active August 29, 2015 14:14
Show Gist options
  • Save tiancheng91/6c4bd2ce398f750d3dc5 to your computer and use it in GitHub Desktop.
Save tiancheng91/6c4bd2ce398f750d3dc5 to your computer and use it in GitHub Desktop.
nginx config for laravel app
server{
listen 80;
server_name laravel.com;
root /root/laravel/public;
index index.php index.html;
location / {
location /static/ {
access_log off;
expires 10d;
add_header Pragma public;
add_header Cache-Control "public, must-revalidate, proxy-revalidate";
}
try_files $uri $uri/ /index.php$is_args$args;
}
location ~ \.php$ {
include fastcgi_params;
fastcgi_index index.php;
fastcgi_pass unix:/var/run/php5-fpm.sock;
fastcgi_read_timeout 300;
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_param PATH_INFO $fastcgi_path_info;
fastcgi_param PATH_TRANSLATED $document_root$fastcgi_path_info;
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