From d1be8b43f699393733ea66a973570084c06e4413 Mon Sep 17 00:00:00 2001 From: MeiMei <30769358+mei23@users.noreply.github.com> Date: Sat, 9 May 2020 08:18:21 +0900 Subject: [PATCH] =?UTF-8?q?brotli=E5=9C=A7=E7=B8=AE=E3=81=AE=E7=84=A1?= =?UTF-8?q?=E5=8A=B9=E5=8C=96=E3=81=AA=E3=81=A9=20Resolve=20#6325=20(#6326?= =?UTF-8?q?)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * disable brotli * disable compress between nginx and app --- docs/examples/misskey.nginx | 1 + src/server/index.ts | 5 +++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/docs/examples/misskey.nginx b/docs/examples/misskey.nginx index 6ed51f020c..382a4edf90 100644 --- a/docs/examples/misskey.nginx +++ b/docs/examples/misskey.nginx @@ -53,6 +53,7 @@ server { proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header X-Forwarded-Proto https; + proxy_set_header Accept-Encoding ""; proxy_http_version 1.1; proxy_redirect off; diff --git a/src/server/index.ts b/src/server/index.ts index 81c70ea518..2834b5b703 100644 --- a/src/server/index.ts +++ b/src/server/index.ts @@ -10,7 +10,7 @@ import * as zlib from 'zlib'; import * as Koa from 'koa'; import * as Router from '@koa/router'; import * as mount from 'koa-mount'; -import * as compress from 'koa-compress'; +const compress = require('koa-compress'); import * as koaLogger from 'koa-logger'; import * as requestStats from 'request-stats'; import * as slow from 'koa-slow'; @@ -50,7 +50,8 @@ if (!['production', 'test'].includes(process.env.NODE_ENV || '')) { // Compress response app.use(compress({ - flush: zlib.constants.Z_SYNC_FLUSH + flush: zlib.constants.Z_SYNC_FLUSH, + br: false })); // HSTS