Welcome! Log In Create A New Profile

Advanced

мусор при выдаче контента с использованием fastcgi_cahce

Posted by Disels 
имеется настроенный хост nginx 0.9.2 + fastcgi php ([b]не php-fpm[/b]) на freebsd 8.1

[code]
gzip on;
gzip_min_length 1100;
gzip_buffers 64 8k;
gzip_comp_level 2;
gzip_http_version 1.1;
gzip_proxied any;
gzip_disable Wget Pingdom.com;
gzip_types application/xml application/x-javascript text/css text/plain;
access_log off;
client_max_body_size 512m;
server_tokens off;

server {
listen 93.190.40.149:80;
server_name site www.site;
root /home/sites/data/www/site;
index index.php index.html;
rewrite ^(/manager/.*)$ https://$host$1 permanent;
location ~* ^/(webstat/|awstats|webmail/|myadmin/|manimg/) {
proxy_pass http://93.190.40.149:8080;
proxy_redirect http://test.sites-film.net:8080/ /;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Real-IP $remote_addr;
}
location ~* ^.+\.(jpg|jpeg|gif|png|svg|js|css|mp3|ogg|mpe?g|avi|zip|gz|bz2?|rar|swf){
expires 1d;
}
if (!-e $request_filename ) {
rewrite ^/.* /index.php?q=$1 last;
}
error_page 404 /index.php;

location ~ \.php$ {
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME /home/sites/data/www/site$fastcgi_script_name;
fastcgi_param DOCUMENT_ROOT /home/sites/data/www/site;
include fastcgi_params;
}

location ~ /\.ht {
deny all;
}

[/code]

файл fastcgi_params;
[code]
fastcgi_param QUERY_STRING $query_string;
fastcgi_param REQUEST_METHOD $request_method;
fastcgi_param CONTENT_TYPE $content_type;
fastcgi_param CONTENT_LENGTH $content_length;

fastcgi_param SCRIPT_NAME $fastcgi_script_name;
fastcgi_param REQUEST_URI $request_uri;
fastcgi_param DOCUMENT_URI $document_uri;
fastcgi_param DOCUMENT_ROOT $document_root;
fastcgi_param SERVER_PROTOCOL $server_protocol;

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;

# PHP only, required if PHP was built with --enable-force-cgi-redirect
#fastcgi_param REDIRECT_STATUS 200;
[/code]

если включить кеширование
[code]
fastcgi_pass_header Set-Cookie;
fastcgi_ignore_headers Cache-Control Expires;
fastcgi_cache_key "$server_name$request_uri";
fastcgi_cache fastcgi_cache;
fastcgi_temp_path /nginx_cache/temp 1 2;
fastcgi_cache_bypass $arg_nocache;
fastcgi_cache_use_stale updating error timeout invalid_header http_500;
fastcgi_cache_valid 10s;
[/code]

то многим клиентам выдается мусор, куски php кода и html . Немного исправляет ситуацию установка

[code]
gzip_http_version 1.0;
[/code]
но все равно части клиентам, а также wget и сервисам статистики выдается мусор. Есть какое либо решение для данной проблемы ? Проято я не знаю уже что искать в документации.
Я так понимаю, никто с подобным не сталкивался ?
Sorry, you do not have permission to post/reply in this forum.

Online Users

Guests: 257
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