Skip to content

Instantly share code, notes, and snippets.

@gvinaccia
Created October 3, 2012 08:12
Show Gist options
  • Save gvinaccia/3825747 to your computer and use it in GitHub Desktop.
Save gvinaccia/3825747 to your computer and use it in GitHub Desktop.
Nginx: vhost conf
server {
root /srv/www/__DOCROOT__;
index index.php index.html index.htm;
error_log /var/log/nginx/__HOSTNAME__.error.log;
# hostname così come appare in /etc/hosts
server_name __HOSTNAME__;
location / {
try_files $uri $uri/ /index.php;
expires 30d;
}
location ~ \.php$ {
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_pass unix:/var/run/php5-fpm.sock;
fastcgi_index index.php;
include fastcgi_params;
fastcgi_read_timeout 86400s;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment