Skip to content

Instantly share code, notes, and snippets.

@dahngeek
Last active January 17, 2019 00:46
Show Gist options
  • Save dahngeek/6e79125f55f293eb4373f5e576ff4e39 to your computer and use it in GitHub Desktop.
Save dahngeek/6e79125f55f293eb4373f5e576ff4e39 to your computer and use it in GitHub Desktop.
Configuracion para NGINX, DEBIAN 8, PHP. laravel
server {
listen 80 default_server;
listen [::]:80 default_server;
server_name dominio.example.com;
#ojo.. tiene que estar en public.. si es laravel
root /var/www/html/public;
error_log /var/log/nginx/error.log warn;
access_log /var/log/nginx/access.log combined;
# do not log static assets
location ~* ^.+\.(css|js|jpg|jpeg|gif|png|ico|gz|svg|svgz|ttf|otf|woff|eot)$ {
#expires max;
access_log off;
}
# opt-in to the future
add_header "X-UA-Compatible" "IE=Edge,chrome=1";
# security through obscurity
#server_tokens off;
location / {
index index.php index.html index.htm;
#?$args se puede reemplazar por ?$query_string en caso de ser necesario
try_files $uri $uri/ /index.php?$args;
}
location ~ \.php$ {
include snippets/fastcgi-php.conf;
fastcgi_pass unix:/var/run/php5-fpm.sock;
#fastcgi_param APPLICATION_ENV "development";
#include fastcgi_params;
}
location ~ /\.ht {
deny all;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment