Skip to content

Instantly share code, notes, and snippets.

@j0an
Forked from Ilyes512/nginx_laravel
Last active August 29, 2015 14:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save j0an/8a74c44dabc82edd6786 to your computer and use it in GitHub Desktop.
Save j0an/8a74c44dabc82edd6786 to your computer and use it in GitHub Desktop.
server {
listen 80;
server_name domain.com *.domain.com;
root /home/domain.com/public;
index index.php
access_log /var/log/nginx/domain.com/access.log;
error_log /var/log/nginx/domain.com/error.log;
charset utf-8;
location / {
try_files \$uri \$uri/ /app.php?\$query_string /index.php?\$query_string;
}
location = /favicon.ico { log_not_found off; access_log off; }
location = /robots.txt { access_log off; log_not_found off; }
error_page 404 /index.php;
location ~ \.php$ {
try_files $uri =404;
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_pass unix:/var/run/php5-fpm.sock;
fastcgi_index index.php;
include fastcgi_params;
}
# Deny .htaccess file access
location ~ /\.ht {
deny all;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment