A user, Canapin, installed Discourse on a CentOS server and noticed that files weren’t compressed using brotli or gzip, despite it being the default behavior. codinghorror asked if the installation followed the official guide, to which Canapin replied that they followed the INSTALL-cloud.md guide but didn’t use the discourse setup.
sam suggested that the issue might be due to the nginx configuration in CentOS web panel proxying requests improperly. Canapin expressed uncertainty about how to resolve the issue.
However, with the help of @Arkshine, Canapin was able to fix the problem by commenting out the following lines in /etc/nginx/proxy.inc:
proxy_hide_header Vary;
proxy_set_header Accept-Encoding '';
The server now sends files properly compressed by Discourse.
Hi. I installed Discourse on a CentOS server. I also use Centos web panel.
It appears that the files aren’t compressed on Discourse though it is supposed to use brotli by default and fallback to gzip.
Example for this file which is 2.2 MB: https://forum.canapin.win/assets/application-301651b1c7400a000974a9cecafd44ad3304cf647cf17bcfa7af68e9ed1ac4b7.js
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:
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.