【问题标题】:node-http-proxy return content is blanknode-http-proxy 返回内容为空
【发布时间】:2017-12-20 22:14:08
【问题描述】:

我有一个到 apache 服务器的 https 代理 apache 服务器位于节点代理后面 https://localhost:444

var httpsServer = https.createServer(options, function(req, res) {
    sslproxy.web(req, res, {
        target: "https://localhost:444"
    });
}).listen(443);

当我使用浏览器浏览时,内容呈现正常。但是,如果我使用 redleg fileviewer https://aw-snap.info/file-viewer/ 之类的东西或通过 google 获取来获取页面,则内容为空,例如:

HTTP/1.1 200 正常
日期:格林威治标准时间 2017 年 12 月 20 日星期三 22:05:33
服务器:Apache/2.4.25 (Debian)
设置cookie:ct_cookies_test=aeeeadff0ae23e02715de88576a89e37;路径=/
x-frame-options: SAMEORIGIN
内容长度:0
连接:关闭
内容类型:文本/html;字符集=UTF-8

关于为什么 content-length 返回 0,但使用浏览器渲染可以吗?

【问题讨论】:

    标签: node.js node-http-proxy


    【解决方案1】:

    我在响应中看到“x-frame-options: SAMEORIGIN”,所以我猜 CORS 是正确的答案。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2011-12-03
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多