Created
May 1, 2014 20:59
-
-
Save brianmcdo/2aa0181f7e3f1af4efdd to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
server { | |
listen 80; | |
server_name example.com; | |
root /src/path/to/laravel/public; | |
charset utf-8; | |
location / | |
{ | |
index index.php index.html; | |
add_header Access-Control-Allow-Origin *; | |
} | |
# Check if file exists | |
if (!-e $request_filename) | |
{ | |
rewrite / /index.php last; | |
break; | |
} | |
location ~ \.php(.*)$ | |
{ | |
# Pass the PHP files to PHP FastCGI for processing | |
try_files $uri = 404; | |
fastcgi_pass unix:/var/run/php5-fpm.sock; | |
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; | |
fastcgi_param PATH /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games; | |
include fastcgi_params; ## See /etc/nginx/fastcgi_params | |
fastcgi_index index.php; | |
} | |
# Deny Any Access to .htaccess Files That May Be Present (not usually in issue in Laravel) | |
# include /etc/nginx/includes/deny_htaccess; | |
location ~ /\.ht | |
{ | |
deny all; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment