Skip to content

Instantly share code, notes, and snippets.

@glaucomorais
Last active October 22, 2020 21:16
Show Gist options
  • Save glaucomorais/ae479d965298201e3c9bfb731bf69923 to your computer and use it in GitHub Desktop.
Save glaucomorais/ae479d965298201e3c9bfb731bf69923 to your computer and use it in GitHub Desktop.
server {
charset utf-8;
listen 80;
server_name localhost;
root path-to-project/public;
index index.html index.php;
access_log path-to-project/storage/local/nginx.access.log;
error_log path-to-project/storage/local/nginx.error.log;
location / {
alias path-to-project/site/;
try_files $uri $uri/ /index.html?$args;
}
location /api {
try_files $uri $uri/ /index.php?$args;
}
location ~ \.php$ {
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
#fastcgi_pass unix:/var/run/php/php5.6-fpm.sock; # Ubuntu com o PHP 5.6 (php/ondrej)
#fastcgi_pass unix:/var/run/php5-fpm.sock; # Ubuntu com o PHP 5.5 (padrão)
#fastcgi_pass 127.0.0.1:9000; # Geralmente utilizado pelo CentOS
try_files $uri =404;
}
location ~ /\. {
deny all;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment