Skip to content

Instantly share code, notes, and snippets.

@Ravaelles
Last active November 4, 2016 11:42
Show Gist options
  • Save Ravaelles/0a381bc397343e4ff274 to your computer and use it in GitHub Desktop.
Save Ravaelles/0a381bc397343e4ff274 to your computer and use it in GitHub Desktop.
server {
listen 80 default_server;
listen [::]:80 default_server;
# Default route for Laravel projects
root /var/www/html/public;
# Add index.php to the list if you are using PHP
index index.html index.htm index.php;
# Server IP
server_name 1.2.3.4;
location / {
# First attempt to serve request as file, then
# as directory, then fall back to displaying a 404.
try_files $uri $uri/ /index.php?$query_string;
}
location ~ \.php$ {
try_files $uri /index.php =404;
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_pass unix:/run/php/php5.6-fpm.sock;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment