Nginx+spawn-fcgi

PK
На сайте с 01.03.2010
Offline
93
1606

Ставил на CentOs 5 nginx и spawn-fcgi, да вот беда, ну никак не заводится всё, постоянно 502 выдаёт :( На фре куда прощеж

Кто разбирается, гляньте и пните, куда следует.

Прилагаю конфиги:

nginx.conf

user nginx;

#group nginx;
worker_processes 5;
pid /var/run/nginx.pid;
error_log /var/log/nginx-error.log warn;
events {
worker_connections 1024;
use epoll;
}
http {
include mime.types;
default_type application/octet-stream;
gzip on;
#gzip_static on;
gzip_min_length 2000;
gzip_types text/plain image/png image/x-icon image/jpeg text/xml application/xml application/x-javascript text/javascript text/css text/json;
gzip_disable "msie6";
gzip_comp_level 9;

# log options
log_format main '$remote_addr - $remote_user [$time_local] '
'"$request" $status $bytes_sent '
'"$http_referer" "$http_user_agent" '
'"$gzip_ratio"';

# nginx options
sendfile on;
tcp_nopush on;
tcp_nodelay on;
keepalive_timeout 85;
server_tokens o ff;
# fastcgi
fastcgi_intercept_errors on;

server {
listen 80;
server_name www.site.com site.com ;
access_log /var/log/nginx.site.com.log main;
root /home/sites/site.com/www/;
index index.php index.html;
location / {
try_files $uri $uri/ @rewrite;
}
location @rewrite {
rewrite ^/ (.*)$ /index.php?q=$1;
}
location ~ \.php$ {
include fastcgi_params;
fastcgi_pass unix:/tmp/php-fastcgi.sock;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
location ~* ^.+\.(txt|jpg|jpeg|gif|css|png|js|ico)$ {
access_log off;
expires max;
break;
}
}

}

Вот /etc/sysconfig/spawn-fcgi

OPTIONS="-f /usr/bin/php-cgi -s /tmp/php-fastcgi.sock -C 4 -P /var/run/spawn-fcgi.pid"

Заране благодарю за помощь!

p.s. реврайт в коде и возмодные странности конфигурации - так и должны быть.

Шлю смс-ки отсюда ( http://www.smspilot.ru/?r=3591 )
Andreyka
На сайте с 19.02.2005
Offline
822
#1

php умеет делать свой error_log, там и смотри

Не стоит плодить сущности без необходимости
PK
На сайте с 01.03.2010
Offline
93
#2

нет там такого, впрочем как и Apache, вот есть из логов nginx:


2010/09/29 16:16:41 [error] 12247#0: *22 connect() to unix:/tmp/php-fastcgi.sock failed (111: Connection refused) while connecting to upstream, client: 95.84.136.218, server: www.site.com, request: "GET /index.php HTTP/1.1", upstream: "fastcgi://unix:/tmp/php-fastcgi.sock:", host: "85.17.145.211"
2010/09/29 16:16:41 [error] 12247#0: *22 open() "/home/sites/site.com/www/favicon.ico" failed (2: No such file or directory), client: 95.84.136.218, server: www.site.com, request: "GET /favicon.ico HTTP/1.1", host: "85.17.145.211", referrer: "http://85.17.145.211/index.php"
2010/09/29 16:16:42 [error] 12247#0: *22 connect() to unix:/tmp/php-fastcgi.sock failed (111: Connection refused) while connecting to upstream, client: 95.84.136.218, server: www.site.com, request: "GET /index.php HTTP/1.1", upstream: "fastcgi://unix:/tmp/php-fastcgi.sock:", host: "85.17.145.211"
2010/09/29 16:16:42 [error] 12247#0: *22 open() "/home/sites/site.com/www/favicon.ico" failed (2: No such file or directory), client: 95.84.136.218, server: www.site.com, request: "GET /favicon.ico HTTP/1.1", host: "85.17.145.211", referrer: "http://85.17.145.211/index.php"
2010/09/29 16:52:26 [error] 12247#0: *26 connect() to unix:/tmp/php-fastcgi.sock failed (111: Connection refused) while connecting to upstream, client: 95.84.136.218, server: www.site.com, request: "GET / HTTP/1.1", upstream: "fastcgi://unix:/tmp/php-fastcgi.sock:", host: "85.17.145.211"

LM
На сайте с 18.10.2009
Offline
117
#3
Pahom-ka:
ну никак не заводится всё, постоянно 502 выдаёт

http://hosting101.ru/502-bad-gateway-nginx.html

Авторизуйтесь или зарегистрируйтесь, чтобы оставить комментарий