Посторонние символы перед заголовком ответа
Станислав
korchasa at gmail.com
Mon Sep 29 00:50:54 MSD 2008
Борис Долгов пишет:
> А какие заголовки отдает фронтэнд перед редиректом? Какой когфиг
> сервера/location'a?
> Ясновидящие в отпуске :(
Хм. Я надеялся, что это какая-то типичная проблема. Дело не в редиректе,
ошибка может появиться на абсолютно любой странице.
-----------------------nginx.conf---------------
user apache apache;
worker_processes 7;
worker_rlimit_nofile 10240;
pid /var/run/nginx.pid;
error_log /var/log/nginx/error_log info;
events {
worker_connections 2048;
}
http {
include conf/mime.types;
default_type application/octet-stream;
client_header_timeout 1m;
client_body_timeout 1m;
send_timeout 1m;
client_header_buffer_size 4k;
large_client_header_buffers 4 8k;
gzip off;
output_buffers 5 64k;
postpone_output 1460;
sendfile on;
tcp_nopush on;
tcp_nodelay on;
keepalive_timeout 75 20;
include conf/servers/www.conf;
upstream main_backend {
server 10.0.0.10:9000;
}
}
-------------------www.conf--------------
server {
listen 80;
server_name www.site.ru;
client_max_body_size 10M;
client_body_buffer_size 128k;
client_body_temp_path /var/home/www/var/client_body;
root /var/home/www/www;
log_format fastcgi_log '$remote_addr $request $status $body_bytes_sent'
' $http_referer $upstream_response_time $request_time $time_local
[$host $http_user_agent]';
log_format static_log '$remote_addr $request $status $body_bytes_sent'
' $http_referer - $request_time $time_local $host [$http_user_agent]';
access_log /var/log/nginx/www-nginx.access_log fastcgi_log;
error_log /var/log/nginx/www-nginx.error_log error;
rewrite_log off;
set $fix_slash 0;
if ($request_uri ~ "^[a-z0-9\-/]*[^/]$") { set $fix_slash 1; }
if (-e $request_filename) { set $fix_slash 0; }
if ($fix_slash) {
rewrite ^(.*)$ $request_uri/ permanent;
}
location / {
root /var/home/www/www;
if (!-e $request_filename) {
rewrite ^(.*)$ /main_app.php last;
}
}
location ~ \.php$ {
charset utf-8;
fastcgi_pass 10.0.0.11:9000;
fastcgi_connect_timeout 20;
fastcgi_send_timeout 60;
fastcgi_read_timeout 60;
fastcgi_buffers 64 128k;
fastcgi_temp_file_write_size 256k;
fastcgi_intercept_errors on;
fastcgi_param SCRIPT_FILENAME /var/home/www/www$fastcgi_script_name;
fastcgi_param QUERY_STRING $query_string;
fastcgi_param REQUEST_METHOD $request_method;
fastcgi_param REMOTE_ADDR $remote_addr;
fastcgi_param REMOTE_PORT $remote_port;
fastcgi_param SERVER_PROTOCOL $server_protocol;
fastcgi_param SERVER_ADDR $server_addr;
fastcgi_param SERVER_PORT $server_port;
fastcgi_param SERVER_NAME $server_name;
fastcgi_param SCRIPT_NAME $fastcgi_script_name;
fastcgi_param REQUEST_URI $request_uri;
fastcgi_param DOCUMENT_ROOT /var/home/www/www;
fastcgi_param CONTENT_TYPE $content_type;
fastcgi_param CONTENT_LENGTH $content_length;
}
error_page 404 /404.html;
error_page 500 502 503 504 /500.html;
location ~* \.(jpg|js|jpeg|gif|png|css)$ {
access_log /var/log/nginx/www-nginx.access_static_log static_log;
expires 30d;
if (!-e $request_filename) {
return 404;
}
}
}
More information about the nginx-ru
mailing list