+0.10
Рейтинг
0.28
Сила

elasticweb

Конфигурация nginx для работы Livestreet

Наша команда активно использует nginx как самостоятельный веб-сервер. Мы с легкостью отказались от apache, и призываем к этому всех наших клиентов.

Для всех неравнодушных к хостингу Livestreet и производительности их сайтов публикуем конфиг для nginx:

root /home/{username}/domains/{parent_domain};

location / {
try_files $uri $uri/ /index.php?q=$uri&$args;
}

location ~* /templates/.*\.(tpl|php)$ {
deny all;
}

location /tmp {
deny all;
}

location ~ /\. {
deny all;
}

location ~ \.(tpl|xml|log|sql)$ {
deny all;
}

location ~*  \.(jpg|jpeg|png|gif|ico|css|js)$ {
expires 7d;
}

location ~ \.php$ {
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_intercept_errors on;
fastcgi_pass unix:/var/run/php5-{domain}.sock;
}


Для ваших PR всегда доступен репозиторий: github.com/elasticweb/nginx-configs