Skip to content

Instantly share code, notes, and snippets.

@sergeysova
Created October 8, 2014 13:09
Show Gist options
  • Save sergeysova/f6c4dfeb2eee107c0bd7 to your computer and use it in GitHub Desktop.
Save sergeysova/f6c4dfeb2eee107c0bd7 to your computer and use it in GitHub Desktop.
nginx.site.conf
server {
listen 80;
root /var/www/intra/;
index index.php index.html index.htm;
server_name intra.local;
location / {
try_files $uri $uri/ =404;
}
location ~ \.(js|css|png|jpg|gif|swf|ico|pdf|mov|fla|zip|rar|woff|eot|svg|ttf) {
try_files $uri =404;
}
location ~ {
try_files $uri /index.php?$query_string;
fastcgi_split_path_info ^(.+\.php)(.*)$;
set $fsn /index.php;
if (-f $document_root$fastcgi_script_name){
set $fsn $fastcgi_script_name;
}
fastcgi_pass unix:/var/run/php5-fpm.sock;
fastcgi_index index.php;
include fastcgi_params;
fastcgi_param PATH_INFO $fastcgi_path_info;
fastcgi_param PATH_TRANSLATED $document_root$fsn;
}
location ~ \.php$ {
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_pass unix:/var/run/php5-fpm.sock;
fastcgi_index index.php;
include fastcgi_params;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment