Welcome! Log In Create A New Profile

Advanced

Проблема с fastcgi_cache

December 09, 2010 04:45AM
Имеется связка nginx v 0.8.53 + fastcgi php 5.3.3 ([b]не php-fpm[/b])
включено сжатие gzip

[code]
gzip on;
gzip_min_length 1100;
gzip_buffers 64 8k;
gzip_comp_level 2;
gzip_http_version 1.1;
gzip_proxied any;
gzip_types application/xml application/x-javascript text/css text/plain;
access_log off;
client_max_body_size 512m;
server_tokens off;
server {
listen 192.168.0.1:80;
server_name server;
root /home/www;
access_log /home/logs/server.access.log;
index index.php index.html;
rewrite ^(/manager/.*)$ https://$host$1 permanent;
location ~* ^/(webstat/|awstats|webmail/|myadmin/|manimg/) {
proxy_pass http://192.168.0.1:8080;
proxy_redirect http://servers: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?|
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/www$fastcgi_scri
fastcgi_param DOCUMENT_ROOT /home/www;

include fastcgi_params;
}

location ~ /\.ht {
deny all;
}
}
[/code]
Все работает нормально . Но если включить fastcgi_cache
[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 или сервисом для проверки скорости загрузки, натыкается на мусор.
если gzip отключить вообще , то всем клиентам без исключения выдается мусор
Честно говоря не знаю даже что искать в документации или google. Кто то с подобным сталкивался ?
Subject Author Posted

Проблема с fastcgi_cache

Disels December 09, 2010 04:45AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

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