С автозагрузки ничего не происходит. nginx отвечает 502 Bad Gateway, но если стартануть в ручную, то все запускается и работает на УРА.
Подскажите где грабли
nginx.conf
worker_processes 2;
error_log /var/nginx/nginx.error.log info;
pid /var/nginx/nginx.pid;
events {
worker_connections 1024;
use kqueue;
}
http {
include conf/mime.types;
default_type application/octet-stream;
log_format main '$remote_addr - $remote_user [$time_local] $request '
'"$status" $body_bytes_sent "$http_referer" '
'"$http_user_agent" "$http_x_forwarded_for"';
access_log off main;
error_log logs/error.log info;
sendfile on;
tcp_nopush on;
tcp_nodelay on;
gzip on;
gzip_min_length 1100;
gzip_comp_level 9;
gzip_types text/plain;
# HOST xxx.domain.ru
server
{
listen 87.240.x.xxx:80;
server_name xxx.domain.ru www.xxx.domain.ru;
location /
{
root html;
fastcgi_pass_header Authorization;
fastcgi_intercept_errors off;
fastcgi_pass unix:/tmp/py_project_1.sock;
fastcgi_param PATH_INFO $fastcgi_script_name;
fastcgi_param REQUEST_METHOD $request_method;
fastcgi_param QUERY_STRING $query_string;
fastcgi_param CONTENT_TYPE $content_type;
fastcgi_param CONTENT_LENGTH $content_length;
fastcgi_param SERVER_PORT $server_port;
fastcgi_param SERVER_PROTOCOL $server_protocol;
fastcgi_param SERVER_NAME $server_name;
fastcgi_param REQUEST_URI $request_uri;
fastcgi_param DOCUMENT_URI $document_uri;
fastcgi_param DOCUMENT_ROOT $document_root;
fastcgi_param SERVER_ADDR $server_addr;
fastcgi_param REMOTE_USER $remote_user;
fastcgi_param REMOTE_ADDR $remote_addr;
fastcgi_param REMOTE_PORT $remote_port;
fastcgi_param SERVER_SOFTWARE "nginx";
fastcgi_param GATEWAY_INTERFACE "CGI/1.1";
}
}
}
#!/bin/sh
PROJECT="project_1"
PROJDIR="/srv/www/htdocs-video1/$PROJECT"
PIDFILE="/tmp/project_1.pid"
SOCKET="/tmp/py_project_1.sock"
cd $PROJDIR
if [ -f $PIDFILE ]; then
kill `cat $PIDFILE`
rm -f -- $PIDFILE
fi
exec /usr/bin/env \
python \
./manage.py runfcgi method=prefork socket=$SOCKET daemonize=true pidfile=$PIDFILE