Я пытаюсь использовать сокеты вместо tcp для nginx
и fastcgi
.
Ниже мой конфиг для nginx. Это работает, если я использую 127.0.0.1:9001, т.е. tcp соединение.
Вот журнал ошибок.
2012/03/06 22:04:53 [crit] 19328#0: *1 connect() to unix:/tmp/nginx9001.socket failed (13: Permission denied) while connecting to upstream, client: 127.0.0.1, server: 127.0.0.1, request: "GET /pixel/ HTTP/1.1", upstream: "fastcgi://unix:/tmp/nginx9001.socket:", host: "127.0.0.1"
Nginx conf:
location /pixel/ {
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 GATEWAY_INTERFACE CGI/1.1;
fastcgi_param SERVER_SOFTWARE nginx/$nginx_version;
fastcgi_param REMOTE_ADDR $remote_addr;
fastcgi_param REMOTE_PORT $remote_port;
fastcgi_param SERVER_ADDR $server_addr;
fastcgi_param SERVER_PORT $server_port;
fastcgi_param SERVER_NAME $server_name;
fastcgi_param SERVER_PROTOCOL $server_protocol;
fastcgi_param SCRIPT_FILENAME $fastcgi_script_name;
fastcgi_param PATH_INFO $fastcgi_script_name;
#fastcgi_pass 127.0.0.1:9001;
fastcgi_pass unix:/tmp/nginx9001.socket;
}
Вот мой скрипт spawn-fcgi
exec spawn-fcgi -n -d /home/ubuntu/workspace/rtbopsConfig/rtbServers/ -s /tmp/nginx9001.socket -f /home/ubuntu/workspace/rtbopsConfig/rtbServers/index.py >> /var/log/test.sys.log 2>&1