Canapin
(Coin-coin le Canapin)
2019 年 10 月 12 日午後 11:39
1
こんにちは。CentOS サーバーに Discourse をインストールしました。CentOS Web Panel も使用しています。
Discourse はデフォルトで Brotli を使用し、fallback として gzip を使用するはずですが、ファイルが圧縮されていないようです。
例として、この 2.2 MB のファイル:
https://forum.canapin.win/assets/application-301651b1c7400a000974a9cecafd44ad3304cf647cf17bcfa7af68e9ed1ac4b7.js
レスポンスヘッダー:
accept-ranges: bytes
cache-control: max-age=31536000
cache-control: public,immutable
content-length: 2334732
content-type: application/javascript
date: Sat, 12 Oct 2019 23:36:50 GMT
expires: Sun, 11 Oct 2020 23:36:50 GMT
last-modified: Sat, 12 Oct 2019 23:33:24 GMT
server: nginx/1.16.1
status: 200
リクエストヘッダー:
:authority: forum.canapin.win
:method: GET
:path: /assets/application-301651b1c7400a000974a9cecafd44ad3304cf647cf17bcfa7af68e9ed1ac4b7.js
:scheme: https
accept: */*
accept-encoding: gzip, deflate, br
accept-language: en-US,en;q=0.9
cache-control: no-cache
cookie: _t=89fc0a58f2a08712f3156f2687553cf8; __profilin=p%3Dt%2Ca%3Da546654bdc3538a213cd6c6fcc4c2a92; _forum_session=YnhETkNaTjF1YTEzVXUvZW1pS1NuTVVzdm1WWndlRktMdmNlU3hBalR3dUYwRGVUTzhBSlM5WkNiS0hDdVQvRmtGeGtLOTRRNndRWk9YUFczbTJHdjMyajlNNkpXZ2xzeEZwMkVmd2grcHlILzJVVmZWeFVVNlBERVF4S3VDMkJ0N2pUWktJWitmbXc2MDFFV1VEcG56M09jalRjMEJOb2t6M1NSbjJQUit1eDFRZkdCMGplVjhLK1JUNFVNdnRmVmZuK1B1NVdwK0N5Q1VrNTdDa01tdXh1T3h2aDY4OGx0SDMzRC9Ma0YzdElFS0p6b0x3algvVnRhVlljVDQyOS0tYnpSeFl5MjNoMVFVMm42UE0ybFJ6Zz09--b49c4c072e917618f874818e246298bce81235e5
dnt: 1
pragma: no-cache
referer: https://forum.canapin.win/
sec-fetch-mode: no-cors
sec-fetch-site: same-origin
user-agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.120 Safari/537.36
なぜそうなるのか、ご存知でしょうか?
「いいね!」 1
Is your install a standard one following our official install guide w/docker?
「いいね!」 2
Canapin
(Coin-coin le Canapin)
2019 年 10 月 13 日午前 12:43
3
I followed this :
discourse/docs/INSTALL-cloud.md at main · discourse/discourse · GitHub
And I just changed the ports in app.yml before bootstrapping the app since the port 80 was already used.
I didnt use discourse setup, I already had docker installed.
「いいね!」 1
Canapin
(Coin-coin le Canapin)
2019 年 10 月 13 日午前 10:10
4
To be very precise about how I installed Discourse, here are the steps I followed:
git clone https://github.com/discourse/discourse_docker.git /var/discourse
cd /var/discourse
cp samples/standalone.yml containers/app.yml
Changed my ports here:
## which TCP/IP ports should this container expose?
## If you want Discourse to share a port with another webserver like Apache or nginx,
## see https://meta.discourse.org/t/17247 for details
expose:
- "8080:80" # fwd host port 80 to container port 8080 (http)
- "4443:443" # fwd host port 443 to container port 4443 (https)
./launcher bootstrap app
./launcher start app
And redirected my port in my nginx configuration in centos web panel:
That’s all.
sam
(Sam Saffron)
2019 年 10 月 14 日午前 1:23
5
Well there is your problem, it is proxying stuff and not passing stuff through properly.
I would recommend just keeping to our standard install which directly connects the internet to our container and handles all this stuff for you.
「いいね!」 4
Canapin
(Coin-coin le Canapin)
2019 年 10 月 14 日午前 9:36
6
Thank you. I don’t know much about servers and stuff like this and I don’t know how I can achieve that. I previously used Plesk with its default settings and it was working perfectly even with nginx proxying.
I’ll try to figure this out anayway I guess.
Canapin
(Coin-coin le Canapin)
2019 年 10 月 14 日午後 10:50
7
Thanks to @Arkshine my issue was fixed.
I had to comment theses lines in /etc/nginx/proxy.inc:
proxy_hide_header Vary;
proxy_set_header Accept-Encoding '';
The server now sends the files properly compressed by Discourse:
「いいね!」 3
system
(system)
クローズされました:
2019 年 11 月 13 日午後 10:56
8
This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.