Welcome! Log In Create A New Profile


Связка nginx/fastcgi возвращает пустой контент и статус 200

May 24, 2011 05:52PM
Никак не могу даже увидеть, где ошибка. nginx работает, отдаёт статичные файлы и бэкэнд к apache работает хорошо. Хочу поднять php/fpm.
fastcgi занимает сокет или порт, но не возвращая контент в nginx, возвращает нормальные заголовки и статус 200, но без контента.
$document_root и $fastcgi_script возвращают корректные значения (в логах).
Доступ к папке для nobody на чтение есть.
php-cgi index.php возвращает корректный контент.
Gentoo, php собран с модулями cli, cgi, fpm, apache2

--------------- - [25/May/2011:00:54:48 +0400] "GET /index.php HTTP/1.1" 200 160 ["/var/www/localhost/htdocs/index.php"]

2011/05/25 00:54:48 [info] 16375#0: *1 client closed keepalive connection

worker_processes 1;
user nginx nginx;
pid /var/run/nginx.pid;
error_log /var/log/nginx/error_log info;

events {
worker_connections 1024; # increase if you have lots of clients
accept_mutex off; # "on" if nginx worker_processes > 1
use epoll; # enable for Linux 2.6+

http {
include /etc/nginx/mime.types;

default_type application/octet-stream;

log_format test
'$remote_addr $remote_user [$time_local] '
' "$request" $status $bytes_sent '
' ["$document_root$fastcgi_script_name"] ';

sendfile on;

tcp_nopush on; # off may be better for *some* Comet/long-poll stuff
tcp_nodelay off; # on may be better for some Comet/long-poll stuff

gzip on;
gzip_http_version 1.0;
gzip_proxied any;
gzip_min_length 500;
gzip_disable "MSIE [1-6]\.";
gzip_buffers 4 8k;
gzip_types text/plain text/xml text/css
text/javascript application/x-javascript;

server { # localhost test
listen 80;
server_name localhost;

access_log /var/log/nginx/localhost-access.log test;
error_log /var/log/nginx/localhost-error.log info;

location / {
root /var/www/localhost/htdocs;
index index.php;

location ~ \.php$ {
root /var/www/localhost/htdocs;
fastcgi_pass unix:/var/run/fpm.sock;
fastcgi_index index.php;
include fastcgi_params;


pid = /var/run/php-fpm.pid
error_log = /var/log/php-fpm/error.log
log_level = notice
listen = /var/run/fpm.sock
user = nobody
group = nobody
pm = static
pm.max_children = 20
Subject Author Posted

Связка nginx/fastcgi возвращает пустой контент и статус 200

danchenkov May 24, 2011 05:52PM

Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 107
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready