Skip to content

Instantly share code, notes, and snippets.

@danielmelogpi
Created March 16, 2014 06:02
Show Gist options
  • Save danielmelogpi/9579212 to your computer and use it in GitHub Desktop.
Save danielmelogpi/9579212 to your computer and use it in GitHub Desktop.
server part for NGINX configuration
server {
listen 80;
server_name domain.tk;
access_log logs/danielmelo.access.log ;# main;
location / {
try_files $uri $uri/ index.php index.html =404;
root /var/www/nginx/danielmelo;
index index.php index.html index.htm;
log_not_found on;
}
location ~* \.(ico|css|js|gif|jpe?g|png)(\?[0-9]+)?$ {
expires max;
log_not_found off;
}
location ~ \.(php|phtml)$ {
try_files $uri index.php =404;
include /etc/nginx/fastcgi_params;
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
root /var/www/nginx/danielmelo/;
fastcgi_param SCRIPT_FILENAME /var/www/nginx/danielmelo$fastcgi_script_name;
log_not_found on;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment