server
{
include common/upstream;
include common/php-fpm;
include common/cache;
listen 80;
listen 443 ssl; # использовать шифрование для этого порта
root /var/www/phalcon/public;
index index.php index.html index.htm;
server_name stuffplace.ru www.stuffplace.ru;
location ~ \.php$ {
try_files $uri =404;
fastcgi_pass 127.0.0.1:9000;
fastcgi_index /index.php;
include fastcgi_params;
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
}
location ~* ".+\.(?:ogg|ogv|svg|svgz|eot|otf|woff|mp4|ttf|rss|css|swf|js|atom|jpe?g|gif|png|ico|zip|tgz|gz|rar|bz2|doc|xls|exe|ppt|tar|mid|midi|wav|bmp|rtf)$"
{
access_log off;
log_not_found off;
expires max;
}
# Настройки порта или сокета PHP-FPM производятся в файле "/etc/php5/fpm/pool.d/www.conf"
fastcgi_pass 127.0.0.1:9000;
# Порядок важен - строчка "include fastcgi_params" должна быть первой
include fastcgi_params;
fastcgi_split_path_info ^(.+?\.php)(/.*)?$;
# Вместо переменной "$document_root" можно указать адрес к корневому каталогу сервера и это желательно (см. http://wiki.nginx.org/Pitfalls)
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param PATH_TRANSLATED $document_root$fastcgi_script_name;
# См. http://trac.nginx.org/nginx/ticket/321
set $path_info $fastcgi_path_info;
fastcgi_param PATH_INFO $path_info;
# Additional variables
fastcgi_param SERVER_ADMIN email@example.com;
fastcgi_param SERVER_SIGNATURE nginx/$nginx_version;
fastcgi_index index.php;
location ~ /\.ht {
deny all;
}
}
nginx: [emerg] "upstream" directive is not allowed here in /etc/nginx/common/upstream:2
nginx: configuration file /etc/nginx/nginx.conf test failed