1
我在使用我的機架應用程序生成的Memcaching頁面生成中遇到了一些問題。顯示當nginx獲取memcached機架結果時添加了奇怪的字符串
我存儲通過我的齒條的應用程序在內存緩存與(紅寶石)碼下列位產生的頁面:
require 'dalli'
memcached = Dalli::Client.new("localhost:11211")
memcached.set(req.path_info, response[2][0])
(其中,反應[2] [0]是所生成的HTML代碼)
在我的nginx服務器配置我有以下幾點:
location @rack {
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_pass http://127.0.0.1:9292;
}
location @memcached {
set $memcached_key $request_uri;
memcached_pass localhost:11211;
default_type text/html;
error_page 404 = @rack;
}
location/{try_files @memcached;}
這有點兒工作,但不完全:傳遞給我的瀏覽器中的內容現在開始用:
I"¯[<!DOCTYPE html><html ...
我的問題是: 什麼是額外的位在前面的HTML代碼,我該如何防止它顯示在瀏覽器的結果?